mirror of
https://github.com/Icinga/icinga2.git
synced 2025-04-08 17:05:25 +02:00
Merge pull request #6814 from Icinga/bugfix/conn-close-stall
Restore 'Connection: close' behaviour in HTTP responses
This commit is contained in:
commit
6cd8b7be32
@ -111,6 +111,15 @@ void HttpResponse::Finish()
|
||||
}
|
||||
|
||||
m_State = HttpResponseEnd;
|
||||
|
||||
/* Close the connection on
|
||||
* a) HTTP/1.0
|
||||
* b) Connection: close in the sent header.
|
||||
*
|
||||
* Do this here and not in DataAvailableHandler - there might still be incoming data in there.
|
||||
*/
|
||||
if (m_Request->ProtocolVersion == HttpVersion10 || m_Request->Headers->Get("connection") == "close")
|
||||
m_Stream->Shutdown();
|
||||
}
|
||||
|
||||
bool HttpResponse::Parse(StreamReadContext& src, bool may_wait)
|
||||
|
@ -362,13 +362,6 @@ void HttpServerConnection::DataAvailableHandler()
|
||||
|
||||
close = true;
|
||||
}
|
||||
|
||||
/* Request finished, decide whether to explicitly close the connection. */
|
||||
if (m_CurrentRequest.ProtocolVersion == HttpVersion10 ||
|
||||
m_CurrentRequest.Headers->Get("connection") == "close") {
|
||||
m_Stream->Shutdown();
|
||||
close = true;
|
||||
}
|
||||
} else
|
||||
close = true;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user