HTTP connections aren't kept alive unless explicitly enabled.
Only the client can decide that the connection can be kept alive, we must close the socket if the client doesn't indicate keepalive support. This will provide a fix for #390 when #560 is fixed; until then the issue remains, just it's no longer HTTPServer's fault.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user