summaryrefslogtreecommitdiffstats
path: root/src/HTTPServer/HTTPConnection.cpp
diff options
context:
space:
mode:
authorTycho <work.tycho+git@gmail.com>2014-01-20 18:21:47 +0100
committerTycho <work.tycho+git@gmail.com>2014-01-20 18:21:47 +0100
commit16375f6aad355333d1d3aff6140cdb4439a9b62f (patch)
treeeb4192092b928e90aebaf914288d12c9cafaf5a5 /src/HTTPServer/HTTPConnection.cpp
parentAdded Inifile and OSSupport Linking (diff)
parentAPIDump: Added notes about objects across cWorld's task execution. (diff)
downloadcuberite-16375f6aad355333d1d3aff6140cdb4439a9b62f.tar
cuberite-16375f6aad355333d1d3aff6140cdb4439a9b62f.tar.gz
cuberite-16375f6aad355333d1d3aff6140cdb4439a9b62f.tar.bz2
cuberite-16375f6aad355333d1d3aff6140cdb4439a9b62f.tar.lz
cuberite-16375f6aad355333d1d3aff6140cdb4439a9b62f.tar.xz
cuberite-16375f6aad355333d1d3aff6140cdb4439a9b62f.tar.zst
cuberite-16375f6aad355333d1d3aff6140cdb4439a9b62f.zip
Diffstat (limited to 'src/HTTPServer/HTTPConnection.cpp')
-rw-r--r--src/HTTPServer/HTTPConnection.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/HTTPServer/HTTPConnection.cpp b/src/HTTPServer/HTTPConnection.cpp
index 3d30ab177..78b7ce4d9 100644
--- a/src/HTTPServer/HTTPConnection.cpp
+++ b/src/HTTPServer/HTTPConnection.cpp
@@ -26,7 +26,7 @@ cHTTPConnection::cHTTPConnection(cHTTPServer & a_HTTPServer) :
cHTTPConnection::~cHTTPConnection()
{
- // LOGD("HTTP: Del connection at %p", this);
+ delete m_CurrentRequest;
}
@@ -205,6 +205,12 @@ void cHTTPConnection::DataReceived(const char * a_Data, int a_Size)
{
m_State = wcsRecvIdle;
m_HTTPServer.RequestFinished(*this, *m_CurrentRequest);
+ if (!m_CurrentRequest->DoesAllowKeepAlive())
+ {
+ m_State = wcsInvalid;
+ m_HTTPServer.CloseConnection(*this);
+ return;
+ }
delete m_CurrentRequest;
m_CurrentRequest = NULL;
}