/** * account.h: Data structures for account information. * * Copyright © 2007 Pippijn van Steenhoven / The Ermyth Team * Rights to this code are as documented in COPYING. * * * Portions of this file were derived from sources bearing the following license: * Copyright © 2005 Atheme Development Group * Rights to this code are as documented in doc/pod/license.pod. * * Generic HTTP server * * $Id: httpd.h,v 1.5 2007/09/22 14:27:28 pippijn Exp $ */ #ifndef HTTPD_H #define HTTPD_H #include #include struct path_handler_t { char *path; void (*handler) (connection_t *, void *); }; typedef std::vector pathvec; struct httpddata { char method[64]; char filename[256]; char *replybuf; char *requestbuf; int length; int lengthdone; bool connection_close; bool correct_content_type; bool expect_100_continue; bool sent_reply; httpddata () : replybuf (0), requestbuf (0), length (0), lengthdone (0), connection_close (false), correct_content_type (false), expect_100_continue (false), sent_reply (false) { method[0] = 0; filename[0] = 0; } void clear (void); }; struct pathhandler_eq { pathhandler_eq (char const * const otherpath) : path (otherpath) { } bool operator () (path_handler_t const &other) { return !strcmp (other.path, path); } private: char const * const path; }; #endif