mirror of https://github.com/Icinga/icinga2.git
parent
c08ad9fd12
commit
b42bfc822b
|
@ -80,7 +80,14 @@ void HttpServerConnection::Disconnect(void)
|
||||||
ApiListener::Ptr listener = ApiListener::GetInstance();
|
ApiListener::Ptr listener = ApiListener::GetInstance();
|
||||||
listener->RemoveHttpClient(this);
|
listener->RemoveHttpClient(this);
|
||||||
|
|
||||||
m_Stream->Shutdown();
|
m_CurrentRequest.~HttpRequest();
|
||||||
|
new (&m_CurrentRequest) HttpRequest(Stream::Ptr());
|
||||||
|
|
||||||
|
{
|
||||||
|
Stream::Ptr stream = m_Stream;
|
||||||
|
m_Stream.reset();
|
||||||
|
stream->Close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HttpServerConnection::ProcessMessage(void)
|
bool HttpServerConnection::ProcessMessage(void)
|
||||||
|
@ -204,6 +211,9 @@ void HttpServerConnection::DataAvailableHandler(void)
|
||||||
{
|
{
|
||||||
bool close = false;
|
bool close = false;
|
||||||
|
|
||||||
|
if (!m_Stream)
|
||||||
|
return;
|
||||||
|
|
||||||
if (!m_Stream->IsEof()) {
|
if (!m_Stream->IsEof()) {
|
||||||
boost::mutex::scoped_lock lock(m_DataHandlerMutex);
|
boost::mutex::scoped_lock lock(m_DataHandlerMutex);
|
||||||
|
|
||||||
|
|
|
@ -129,7 +129,11 @@ void JsonRpcConnection::Disconnect(void)
|
||||||
Log(LogWarning, "JsonRpcConnection")
|
Log(LogWarning, "JsonRpcConnection")
|
||||||
<< "API client disconnected for identity '" << m_Identity << "'";
|
<< "API client disconnected for identity '" << m_Identity << "'";
|
||||||
|
|
||||||
m_Stream->Close();
|
{
|
||||||
|
Stream::Ptr stream = m_Stream;
|
||||||
|
m_Stream.reset();
|
||||||
|
stream->Close();
|
||||||
|
}
|
||||||
|
|
||||||
if (m_Endpoint)
|
if (m_Endpoint)
|
||||||
m_Endpoint->RemoveClient(this);
|
m_Endpoint->RemoveClient(this);
|
||||||
|
@ -234,6 +238,9 @@ void JsonRpcConnection::DataAvailableHandler(void)
|
||||||
{
|
{
|
||||||
bool close = false;
|
bool close = false;
|
||||||
|
|
||||||
|
if (!m_Stream)
|
||||||
|
return;
|
||||||
|
|
||||||
if (!m_Stream->IsEof()) {
|
if (!m_Stream->IsEof()) {
|
||||||
boost::mutex::scoped_lock lock(m_DataHandlerMutex);
|
boost::mutex::scoped_lock lock(m_DataHandlerMutex);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue