From 28b41ece14dc4a291dee6562f6ea203e641a3b34 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 17 Sep 2006 21:04:20 +0000 Subject: [PATCH] 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 --- src/modules/m_httpd.cpp | 18 ++++++++++++++---- 1 file 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 -#include "users.h" -#include "channels.h" +#include #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")) -- 2.39.5