diff options
author | Tycho <work.tycho+git@gmail.com> | 2014-05-24 13:44:49 +0200 |
---|---|---|
committer | Tycho <work.tycho+git@gmail.com> | 2014-05-24 13:44:49 +0200 |
commit | 4ab82881165cb180b020e67f851028718ab84d87 (patch) | |
tree | 93e773ebd46fb76dd520821133b01f6d99b26e94 /src/HTTPServer/HTTPConnection.cpp | |
parent | Ignore CTest files (diff) | |
parent | Merge pull request #1022 from mc-server/FixMineshafts (diff) | |
download | cuberite-4ab82881165cb180b020e67f851028718ab84d87.tar cuberite-4ab82881165cb180b020e67f851028718ab84d87.tar.gz cuberite-4ab82881165cb180b020e67f851028718ab84d87.tar.bz2 cuberite-4ab82881165cb180b020e67f851028718ab84d87.tar.lz cuberite-4ab82881165cb180b020e67f851028718ab84d87.tar.xz cuberite-4ab82881165cb180b020e67f851028718ab84d87.tar.zst cuberite-4ab82881165cb180b020e67f851028718ab84d87.zip |
Diffstat (limited to 'src/HTTPServer/HTTPConnection.cpp')
-rw-r--r-- | src/HTTPServer/HTTPConnection.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/HTTPServer/HTTPConnection.cpp b/src/HTTPServer/HTTPConnection.cpp index da4df0e34..b127e7091 100644 --- a/src/HTTPServer/HTTPConnection.cpp +++ b/src/HTTPServer/HTTPConnection.cpp @@ -26,6 +26,7 @@ cHTTPConnection::cHTTPConnection(cHTTPServer & a_HTTPServer) : cHTTPConnection::~cHTTPConnection() { + // LOGD("HTTP: Connection deleting: %p", this); delete m_CurrentRequest; } @@ -144,7 +145,7 @@ void cHTTPConnection::Terminate(void) -void cHTTPConnection::DataReceived(const char * a_Data, size_t a_Size) +bool cHTTPConnection::DataReceived(const char * a_Data, size_t a_Size) { switch (m_State) { @@ -162,12 +163,12 @@ void cHTTPConnection::DataReceived(const char * a_Data, size_t a_Size) m_CurrentRequest = NULL; m_State = wcsInvalid; m_HTTPServer.CloseConnection(*this); - return; + return true; } if (m_CurrentRequest->IsInHeaders()) { // The request headers are not yet complete - return; + return false; } // The request has finished parsing its headers successfully, notify of it: @@ -183,13 +184,12 @@ void cHTTPConnection::DataReceived(const char * a_Data, size_t a_Size) // Process the rest of the incoming data into the request body: if (a_Size > BytesConsumed) { - DataReceived(a_Data + BytesConsumed, a_Size - BytesConsumed); + return cHTTPConnection::DataReceived(a_Data + BytesConsumed, a_Size - BytesConsumed); } else { - DataReceived("", 0); // If the request has zero body length, let it be processed right-away + return cHTTPConnection::DataReceived("", 0); // If the request has zero body length, let it be processed right-away } - break; } case wcsRecvBody: @@ -209,7 +209,7 @@ void cHTTPConnection::DataReceived(const char * a_Data, size_t a_Size) { m_State = wcsInvalid; m_HTTPServer.CloseConnection(*this); - return; + return true; } delete m_CurrentRequest; m_CurrentRequest = NULL; @@ -223,6 +223,7 @@ void cHTTPConnection::DataReceived(const char * a_Data, size_t a_Size) break; } } + return false; } |