]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/httpd.h
Remove some debug (im on a crusade to make debug mode useful, but at the same time...
[user/henk/code/inspircd.git] / src / modules / httpd.h
index 565648659e7268e36f07cd5203008a70161718df..a8b0bafcdc81f2c26307d27c8972e67d0c508eac 100644 (file)
@@ -1,3 +1,16 @@
+/*       +------------------------------------+
+ *       | Inspire Internet Relay Chat Daemon |
+ *       +------------------------------------+
+ *
+ *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ * See: http://www.inspircd.org/wiki/index.php/Credits
+ *
+ * This program is free but copyrighted software; see
+ *            the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
 #include "base.h"
 
 #ifndef __HTTPD_H__
@@ -17,6 +30,7 @@ class HTTPRequest : public classbase
        std::string type;
        std::string document;
        std::string ipaddr;
+       std::string postdata;
        std::stringstream* headers;
 
  public:
@@ -33,9 +47,10 @@ class HTTPRequest : public classbase
         * @param hdr The headers sent with the request
         * @param opaque An opaque pointer used internally by m_httpd, which you must pass back to the module in your reply.
         * @param ip The IP address making the web request.
+        * @param pdata The post data (content after headers) received with the request, up to Content-Length in size
         */
-       HTTPRequest(const std::string &request_type, const std::string &uri, std::stringstream* hdr, void* opaque, const std::string &ip)
-               : type(request_type), document(uri), ipaddr(ip), headers(hdr), sock(opaque)
+       HTTPRequest(const std::string &request_type, const std::string &uri, std::stringstream* hdr, void* opaque, const std::string &ip, const std::string &pdata)
+               : type(request_type), document(uri), ipaddr(ip), postdata(pdata), headers(hdr), sock(opaque)
        {
        }
 
@@ -48,6 +63,15 @@ class HTTPRequest : public classbase
                return headers;
        }
 
+       /** Get the post data (request content).
+        * All post data will be returned, including carriage returns and linefeeds.
+        * @return The postdata
+        */
+       std::string& GetPostData()
+       {
+               return postdata;
+       }
+
        /** Get the request type.
         * Any request type can be intercepted, even ones which are invalid in the HTTP/1.1 spec.
         * @return The request type, e.g. GET, POST, HEAD