summaryrefslogtreecommitdiffstats
path: root/src/HTTPServer/HTTPServer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/HTTPServer/HTTPServer.cpp')
-rw-r--r--src/HTTPServer/HTTPServer.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/HTTPServer/HTTPServer.cpp b/src/HTTPServer/HTTPServer.cpp
index bbff5d57a..814a87fe4 100644
--- a/src/HTTPServer/HTTPServer.cpp
+++ b/src/HTTPServer/HTTPServer.cpp
@@ -31,26 +31,26 @@ class cDebugCallbacks :
virtual void OnRequestBegun(cHTTPConnection & a_Connection, cHTTPRequest & a_Request) override
{
UNUSED(a_Connection);
-
+
if (cHTTPFormParser::HasFormData(a_Request))
{
a_Request.SetUserData(new cHTTPFormParser(a_Request, *this));
}
}
-
-
+
+
virtual void OnRequestBody(cHTTPConnection & a_Connection, cHTTPRequest & a_Request, const char * a_Data, size_t a_Size) override
{
UNUSED(a_Connection);
-
+
cHTTPFormParser * FormParser = reinterpret_cast<cHTTPFormParser *>(a_Request.GetUserData());
if (FormParser != nullptr)
{
FormParser->Parse(a_Data, a_Size);
}
}
-
-
+
+
virtual void OnRequestFinished(cHTTPConnection & a_Connection, cHTTPRequest & a_Request) override
{
cHTTPFormParser * FormParser = reinterpret_cast<cHTTPFormParser *>(a_Request.GetUserData());
@@ -69,7 +69,7 @@ class cDebugCallbacks :
a_Connection.Send("</table></body></html>");
return;
}
-
+
// Parsing failed:
cHTTPResponse Resp;
Resp.SetContentType("text/plain");
@@ -77,7 +77,7 @@ class cDebugCallbacks :
a_Connection.Send("Form parsing failed");
return;
}
-
+
// Test the auth failure and success:
if (a_Request.GetURL() == "/auth")
{
@@ -87,31 +87,31 @@ class cDebugCallbacks :
return;
}
}
-
+
cHTTPResponse Resp;
Resp.SetContentType("text/plain");
a_Connection.Send(Resp);
a_Connection.Send("Hello, world");
}
-
-
+
+
virtual void OnFileStart(cHTTPFormParser & a_Parser, const AString & a_FileName) override
{
// TODO
}
-
-
+
+
virtual void OnFileData(cHTTPFormParser & a_Parser, const char * a_Data, size_t a_Size) override
{
// TODO
}
-
+
virtual void OnFileEnd(cHTTPFormParser & a_Parser) override
{
// TODO
}
-
+
};
static cDebugCallbacks g_DebugCallbacks;
@@ -239,7 +239,7 @@ bool cHTTPServer::Start(cCallbacks & a_Callbacks, const AStringVector & a_Ports)
m_ServerHandles.push_back(Handle);
}
} // for port - a_Ports[]
-
+
// Report success if at least one port opened successfully:
return !m_ServerHandles.empty();
}