X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fhttpd.h;h=f40050e36eb90a5f60da4689cd4c1d761ad96ee9;hb=8cebe2878f3878afce6f643d93668155cb26801d;hp=59e099f80992fada01da70897be77d3debdcdaa3;hpb=e4acbc95b8b6cd5b28d38a2242c02e8ff4991e4a;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/httpd.h b/src/modules/httpd.h index 59e099f80..f40050e36 100644 --- a/src/modules/httpd.h +++ b/src/modules/httpd.h @@ -2,8 +2,8 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * InspIRCd: (C) 2002-2008 InspIRCd Development Team - * See: http://www.inspircd.org/wiki/index.php/Credits + * InspIRCd: (C) 2002-2009 InspIRCd Development Team + * See: http://wiki.inspircd.org/Credits * * This program is free but copyrighted software; see * the file COPYING for details. @@ -22,12 +22,12 @@ /** A modifyable list of HTTP header fields */ -class HTTPHeaders +class HTTPHeaders : public classbase { protected: std::map headers; public: - + /** Set the value of a header * Sets the value of the named header. If the header is already present, it will be replaced */ @@ -35,7 +35,7 @@ class HTTPHeaders { headers[name] = data; } - + /** Set the value of a header, only if it doesn't exist already * Sets the value of the named header. If the header is already present, it will NOT be updated */ @@ -44,21 +44,21 @@ class HTTPHeaders if (!IsSet(name)) SetHeader(name, data); } - + /** Remove the named header */ void RemoveHeader(const std::string &name) { headers.erase(name); } - + /** Remove all headers */ void Clear() { headers.clear(); } - + /** Get the value of a header * @return The value of the header, or an empty string */ @@ -67,10 +67,10 @@ class HTTPHeaders std::map::iterator it = headers.find(name); if (it == headers.end()) return std::string(); - + return it->second; } - + /** Check if the given header is specified * @return true if the header is specified */ @@ -79,17 +79,17 @@ class HTTPHeaders std::map::iterator it = headers.find(name); return (it != headers.end()); } - + /** Get all headers, formatted by the HTTP protocol * @return Returns all headers, formatted according to the HTTP protocol. There is no request terminator at the end */ std::string GetFormattedHeaders() { std::string re; - + for (std::map::iterator i = headers.begin(); i != headers.end(); i++) re += i->first + ": " + i->second + "\r\n"; - + return re; } }; @@ -105,11 +105,12 @@ class HTTPRequest : public classbase std::string document; std::string ipaddr; std::string postdata; - + public: HTTPHeaders *headers; - + int errorcode; + /** A socket pointer, which you must return in your HTTPDocument class * if you reply to this request. */ @@ -180,7 +181,7 @@ class HTTPDocument : public classbase public: HTTPHeaders headers; - + /** The socket pointer from an earlier HTTPRequest */ void* sock;