diff options
Diffstat (limited to 'src/WebAdmin.h')
-rw-r--r-- | src/WebAdmin.h | 54 |
1 files changed, 7 insertions, 47 deletions
diff --git a/src/WebAdmin.h b/src/WebAdmin.h index 29acb2664..5e48f597c 100644 --- a/src/WebAdmin.h +++ b/src/WebAdmin.h @@ -8,7 +8,7 @@ #include "Bindings/LuaState.h" #include "IniFile.h" #include "HTTP/HTTPServer.h" -#include "HTTP/HTTPFormParser.h" +#include "HTTP/HTTPMessage.h" @@ -171,46 +171,6 @@ public: static AString GetContentTypeFromFileExt(const AString & a_FileExtension); protected: - /** Common base class for request body data handlers */ - class cRequestData - { - public: - virtual ~cRequestData() {} // Force a virtual destructor in all descendants - - /** Called when a new chunk of body data is received */ - virtual void OnBody(const char * a_Data, size_t a_Size) = 0; - } ; - - /** The body handler for requests in the "/webadmin" and "/~webadmin" paths */ - class cWebadminRequestData : - public cRequestData, - public cHTTPFormParser::cCallbacks - { - public: - cHTTPFormParser m_Form; - - - cWebadminRequestData(cHTTPRequestParser & a_Request) : - m_Form(a_Request, *this) - { - } - - // cRequestData overrides: - virtual void OnBody(const char * a_Data, size_t a_Size) override; - - // cHTTPFormParser::cCallbacks overrides. Files are ignored: - virtual void OnFileStart(cHTTPFormParser &, const AString & a_FileName) override - { - UNUSED(a_FileName); - } - virtual void OnFileData(cHTTPFormParser &, const char * a_Data, size_t a_Size) override - { - UNUSED(a_Data); - UNUSED(a_Size); - } - virtual void OnFileEnd(cHTTPFormParser &) override {} - } ; - /** Set to true if Init() succeeds and the webadmin isn't to be disabled */ bool m_IsInitialized; @@ -236,18 +196,18 @@ protected: cHTTPServer m_HTTPServer; /** Handles requests coming to the "/webadmin" or "/~webadmin" URLs */ - void HandleWebadminRequest(cHTTPServerConnection & a_Connection, cHTTPRequestParser & a_Request); + void HandleWebadminRequest(cHTTPServerConnection & a_Connection, cHTTPIncomingRequest & a_Request); /** Handles requests for the root page */ - void HandleRootRequest(cHTTPServerConnection & a_Connection, cHTTPRequestParser & a_Request); + void HandleRootRequest(cHTTPServerConnection & a_Connection, cHTTPIncomingRequest & a_Request); /** Handles requests for a file */ - void HandleFileRequest(cHTTPServerConnection & a_Connection, cHTTPRequestParser & a_Request); + void HandleFileRequest(cHTTPServerConnection & a_Connection, cHTTPIncomingRequest & a_Request); // cHTTPServer::cCallbacks overrides: - virtual void OnRequestBegun (cHTTPServerConnection & a_Connection, cHTTPRequestParser & a_Request) override; - virtual void OnRequestBody (cHTTPServerConnection & a_Connection, cHTTPRequestParser & a_Request, const char * a_Data, size_t a_Size) override; - virtual void OnRequestFinished(cHTTPServerConnection & a_Connection, cHTTPRequestParser & a_Request) override; + virtual void OnRequestBegun (cHTTPServerConnection & a_Connection, cHTTPIncomingRequest & a_Request) override; + virtual void OnRequestBody (cHTTPServerConnection & a_Connection, cHTTPIncomingRequest & a_Request, const char * a_Data, size_t a_Size) override; + virtual void OnRequestFinished(cHTTPServerConnection & a_Connection, cHTTPIncomingRequest & a_Request) override; } ; // tolua_export |