mirror of https://github.com/Icinga/icinga2.git
/v1/events: terminate on disconnect
This commit is contained in:
parent
4c5ee0dbbf
commit
2e5af2922b
|
@ -117,6 +117,8 @@ bool EventsHandler::HandleRequest(
|
|||
asio::async_write(stream, payload, yc);
|
||||
asio::async_write(stream, newLine, yc);
|
||||
stream.async_flush(yc);
|
||||
} else if (server.Disconnected()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -114,6 +114,11 @@ void HttpServerConnection::StartStreaming()
|
|||
});
|
||||
}
|
||||
|
||||
bool HttpServerConnection::Disconnected()
|
||||
{
|
||||
return m_ShuttingDown;
|
||||
}
|
||||
|
||||
static inline
|
||||
bool EnsureValidHeaders(
|
||||
AsioTlsStream& stream,
|
||||
|
|
|
@ -29,6 +29,8 @@ public:
|
|||
void Disconnect();
|
||||
void StartStreaming();
|
||||
|
||||
bool Disconnected();
|
||||
|
||||
private:
|
||||
ApiUser::Ptr m_ApiUser;
|
||||
std::shared_ptr<AsioTlsStream> m_Stream;
|
||||
|
|
Loading…
Reference in New Issue