mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-20 12:14:44 +02:00
parent
e6a972f975
commit
ec050dd2a7
@ -137,24 +137,28 @@ bool HttpClientConnection::ProcessMessage(void)
|
|||||||
|
|
||||||
void HttpClientConnection::DataAvailableHandler(const Stream::Ptr& stream)
|
void HttpClientConnection::DataAvailableHandler(const Stream::Ptr& stream)
|
||||||
{
|
{
|
||||||
boost::mutex::scoped_lock lock(m_DataHandlerMutex);
|
|
||||||
|
|
||||||
ASSERT(stream == m_Stream);
|
ASSERT(stream == m_Stream);
|
||||||
|
|
||||||
try {
|
bool close = false;
|
||||||
while (ProcessMessage())
|
|
||||||
; /* empty loop body */
|
|
||||||
} catch (const std::exception& ex) {
|
|
||||||
Log(LogWarning, "HttpClientConnection")
|
|
||||||
<< "Error while reading Http response: " << DiagnosticInformation(ex);
|
|
||||||
|
|
||||||
Disconnect();
|
if (!m_Stream->IsEof()) {
|
||||||
}
|
boost::mutex::scoped_lock lock(m_DataHandlerMutex);
|
||||||
|
|
||||||
if (m_Context.Eof) {
|
try {
|
||||||
Log(LogWarning, "HttpClientConnection", "Encountered unexpected EOF while reading Http response.");
|
while (ProcessMessage())
|
||||||
|
; /* empty loop body */
|
||||||
|
} catch (const std::exception& ex) {
|
||||||
|
Log(LogWarning, "HttpClientConnection")
|
||||||
|
<< "Error while reading Http response: " << DiagnosticInformation(ex);
|
||||||
|
|
||||||
|
close = true;
|
||||||
|
Disconnect();
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
close = true;
|
||||||
|
|
||||||
|
if (close)
|
||||||
m_Stream->Close();
|
m_Stream->Close();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::shared_ptr<HttpRequest> HttpClientConnection::NewRequest(void)
|
boost::shared_ptr<HttpRequest> HttpClientConnection::NewRequest(void)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user