diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-09-17 21:04:20 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-09-17 21:04:20 +0000 |
commit | 28b41ece14dc4a291dee6562f6ea203e641a3b34 (patch) | |
tree | d57ee375c292c92388867a8c3712c5850c186d87 /src/modules | |
parent | 72bdd8426591eec98c4ab41a5b4715a8c94b8460 (diff) |
Automatically make http request type and http version string uppercase, add comments, remove some unused headers
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5276 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_httpd.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/modules/m_httpd.cpp b/src/modules/m_httpd.cpp index b44585ba6..3b8bc20b8 100644 --- a/src/modules/m_httpd.cpp +++ b/src/modules/m_httpd.cpp @@ -16,11 +16,8 @@ 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")) |