ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/ermyth/modules/rpc/include/httpd.h
Revision: 1.1
Committed: Thu Jul 19 08:24:55 2007 UTC (19 years, 3 months ago) by pippijn
Content type: text/plain
Branch: MAIN
Log Message:
initial import. the most important changes since Atheme are:
- fixed many memory leaks
- fixed many bugs
- converted to C++ and use more STL containers
- added a (not very enhanced yet) perl module
- greatly improved XML-RPC speed
- added a JSON-RPC module with code from json-cpp
- added a valgrind memcheck module to operserv
- added a more object oriented base64 implementation
- added a specialised unit test framework
- improved stability
- use gettimeofday() if available
- reworked adding/removing commands
- MemoServ IGNORE DEL can now remove indices

File Contents

# User Rev Content
1 pippijn 1.1 /*
2     * Copyright © 2005 Atheme Development Group
3     * Rights to this code are as documented in doc/LICENSE.
4     *
5     * Generic HTTP server
6     *
7     * $Id: httpd.h,v 1.1 2007-07-11 11:04:41 pippijn Exp $
8     */
9    
10     #ifndef HTTPD_H
11     #define HTTPD_H
12    
13     #include <map>
14    
15     #include "common/util.h"
16    
17     struct path_handler_t
18     {
19     char *path;
20     void (*handler) (connection_t *, void *);
21     };
22    
23     typedef std::vector <path_handler_t *> pathvec;
24    
25     struct httpddata
26     {
27     char method[64];
28     char filename[256];
29     char *requestbuf;
30     char *replybuf;
31     int length;
32     int lengthdone;
33     bool connection_close;
34     bool correct_content_type;
35     bool expect_100_continue;
36     bool sent_reply;
37     };
38    
39     struct pathhandler_eq
40     {
41     pathhandler_eq (char const *path) : path (path) { }
42    
43     bool operator () (path_handler_t *other)
44     {
45     return !strcmp (other->path, path);
46     }
47    
48     private:
49     path_handler_t *ph;
50     char const *path;
51     };
52    
53     #endif