ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/ermyth/modules/rpc/include/httpd.h
Revision: 1.3
Committed: Tue Aug 28 17:08:11 2007 UTC (19 years, 1 month ago) by pippijn
Content type: text/plain
Branch: MAIN
Changes since 1.2: +27 -9 lines
Log Message:
- changed name
- updated the example config to the new system
- added more documentation
- enhanced documentation generators
- added a link to the pdf to the website
- added an RSS feed generator
- transitioned hooks to c++ callbacks
- did various merges with upstream along the way
- added const where appropriate
- removed the old block allocator
- fixed most memory leaks
- transitioned some dictionaries to std::map
- transitioned some lists to std::vector
- made some free functions members where appropriate
- renamed string to dynstr and added a static string ststr
- use NOW instead of time (NULL) if possible
- completely reworked database backends, crypto handlers and protocol handlers
  to use an object factory
- removed the old module system. ermyth does not do any dynamic loading anymore
- fixed most of the build system
- reworked how protocol commands work

File Contents

# User Rev Content
1 pippijn 1.1 /*
2     * Copyright © 2005 Atheme Development Group
3 pippijn 1.2 * Rights to this code are as documented in doc/pod/license.pod.
4 pippijn 1.1 *
5     * Generic HTTP server
6     *
7 pippijn 1.3 * $Id: httpd.h,v 1.2 2007-07-21 01:29:10 pippijn Exp $
8 pippijn 1.1 */
9    
10     #ifndef HTTPD_H
11     #define HTTPD_H
12    
13     #include <map>
14    
15 pippijn 1.3 #include <common/util.h>
16 pippijn 1.1
17     struct path_handler_t
18     {
19     char *path;
20     void (*handler) (connection_t *, void *);
21     };
22    
23 pippijn 1.3 typedef std::vector <path_handler_t> pathvec;
24 pippijn 1.1
25     struct httpddata
26     {
27     char method[64];
28     char filename[256];
29 pippijn 1.3 char *replybuf;
30 pippijn 1.1 char *requestbuf;
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 pippijn 1.3
38     httpddata ()
39     : replybuf (0),
40     requestbuf (0),
41     length (0),
42     lengthdone (0),
43     connection_close (false),
44     correct_content_type (false),
45     expect_100_continue (false),
46     sent_reply (false)
47     {
48     method[0] = 0;
49     filename[0] = 0;
50     }
51    
52     void clear (void);
53 pippijn 1.1 };
54    
55     struct pathhandler_eq
56     {
57 pippijn 1.3 pathhandler_eq (char const * const otherpath)
58     : path (otherpath)
59     {
60     }
61 pippijn 1.1
62 pippijn 1.3 bool operator () (path_handler_t const &other)
63 pippijn 1.1 {
64 pippijn 1.3 return !strcmp (other.path, path);
65 pippijn 1.1 }
66    
67     private:
68 pippijn 1.3 char const * const path;
69 pippijn 1.1 };
70    
71     #endif