mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-25 14:44:32 +02:00
Merge pull request #6658 from Icinga/bugfix/api-connection-close-req-by-client
Ensure that HTTP/1.0 or 'Connection: close' headers are properly disconnecting the client
This commit is contained in:
commit
58cfc3955d
@ -111,9 +111,6 @@ 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)
|
||||||
|
@ -358,6 +358,13 @@ void HttpServerConnection::DataAvailableHandler()
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_RequestQueue.Enqueue(std::bind(&Stream::SetCorked, m_Stream, false));
|
m_RequestQueue.Enqueue(std::bind(&Stream::SetCorked, m_Stream, false));
|
||||||
|
|
||||||
|
/* 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…
x
Reference in New Issue
Block a user