mirror of https://github.com/Icinga/icinga2.git
Restore 'Connection: close' behaviour in HTTP responses
Actually the `corked` functionality caused problems with not closing connections properly. Full Analysis: https://github.com/Icinga/icinga2/issues/6799#issuecomment-443710338 Full credits to @swegener :) fixes #6799
This commit is contained in:
parent
5ef23ee06d
commit
a83dbc9de5
|
@ -111,6 +111,9 @@ void HttpResponse::Finish()
|
||||||
}
|
}
|
||||||
|
|
||||||
m_State = HttpResponseEnd;
|
m_State = HttpResponseEnd;
|
||||||
|
|
||||||
|
if (m_Request->ProtocolVersion == HttpVersion10 || m_Request->Headers->Get("connection") == "close")
|
||||||
|
m_Stream->Shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HttpResponse::Parse(StreamReadContext& src, bool may_wait)
|
bool HttpResponse::Parse(StreamReadContext& src, bool may_wait)
|
||||||
|
|
|
@ -362,13 +362,6 @@ void HttpServerConnection::DataAvailableHandler()
|
||||||
|
|
||||||
close = true;
|
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
|
} else
|
||||||
close = true;
|
close = true;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue