]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Automatically make http request type and http version string uppercase, add comments...
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 17 Sep 2006 21:04:20 +0000 (21:04 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 17 Sep 2006 21:04:20 +0000 (21:04 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5276 e03df62e-2008-0410-955e-edbf42e46eb7

src/modules/m_httpd.cpp

index b44585ba6368ba85e87d7763284f06ccf32617b8..3b8bc20b8567563167d108854172f3b6b8409631 100644 (file)
 
 using namespace std;
 
-#include <stdio.h>
-#include "users.h"
-#include "channels.h"
+#include <algorithm>
 #include "modules.h"
-#include "inspsocket.h"
 #include "inspircd.h"
 #include "httpd.h"
 
@@ -43,13 +40,23 @@ enum HttpState
 
 class HttpSocket;
 
+/** This class is used to handle HTTP socket timeouts
+ */
 class HTTPTimeout : public InspTimer
 {
  private:
+       /** HttpSocket we are attached to
+        */
        HttpSocket* s;
+       /** Socketengine the file descriptor is in
+        */
        SocketEngine* SE;
  public:
+       /** Attach timeout to HttpSocket
+        */
        HTTPTimeout(HttpSocket* sock, SocketEngine* engine);
+       /** Handle timer tick
+        */
        void Tick(time_t TIME);
 };
 
@@ -233,6 +240,9 @@ class HttpSocket : public InspSocket
                                        headers >> request_type;
                                        headers >> uri;
                                        headers >> http_version;
+
+                                       std::transform(request_type.begin(), request_type.end(), request_type.begin(), ::toupper);
+                                       std::transform(http_version.begin(), http_version.end(), http_version.begin(), ::toupper);
                                }
 
                                if ((InternalState == HTTP_SERVE_WAIT_REQUEST) && (request_type == "POST"))