1
0

Added cHTTPServer callbacks; fixed keep-alives.

The HTTP server now calls callbacks specified in its start function (debugified atm.) and it processes multiple requests on a single connection.
This commit is contained in:
madmaxoft
2013-09-27 21:28:41 +02:00
parent 8c57c5c1f2
commit 5cf8fc12ae
4 changed files with 132 additions and 13 deletions

View File

@@ -52,9 +52,12 @@ public:
/// Sends the data as the response (may be called multiple times)
void Send(const AString & a_Data) { Send(a_Data.data(), a_Data.size()); }
/// Finishes sending current response, gets ready for receiving another request (HTTP 1.1 keepalive)
/// Indicates that the current response is finished, gets ready for receiving another request (HTTP 1.1 keepalive)
void FinishResponse(void);
/// Resets the connection for a new request. Depending on the state, this will send an "InternalServerError" status or a "ResponseEnd"
void AwaitNextRequest(void);
protected:
typedef std::map<AString, AString> cNameValueMap;