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:
@@ -72,7 +72,8 @@ cHTTPRequest::cHTTPRequest(void) :
|
||||
m_EnvelopeParser(*this),
|
||||
m_IsValid(true),
|
||||
m_UserData(NULL),
|
||||
m_HasAuth(false)
|
||||
m_HasAuth(false),
|
||||
m_AllowKeepAlive(false)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -236,6 +237,10 @@ void cHTTPRequest::OnHeaderLine(const AString & a_Key, const AString & a_Value)
|
||||
m_HasAuth = true;
|
||||
}
|
||||
}
|
||||
if ((a_Key == "Connection") && (NoCaseCompare(a_Value, "keep-alive") == 0))
|
||||
{
|
||||
m_AllowKeepAlive = true;
|
||||
}
|
||||
AddHeader(a_Key, a_Value);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user