mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-09 23:04:29 +02:00
JsonRpcConnection: Raise an exception when trying to send to disconnected clients
This commit is contained in:
parent
02334c5f29
commit
561aedab1d
@ -166,7 +166,7 @@ ConnectionRole JsonRpcConnection::GetRole() const
|
|||||||
void JsonRpcConnection::SendMessage(const Dictionary::Ptr& message)
|
void JsonRpcConnection::SendMessage(const Dictionary::Ptr& message)
|
||||||
{
|
{
|
||||||
if (m_ShuttingDown) {
|
if (m_ShuttingDown) {
|
||||||
return;
|
BOOST_THROW_EXCEPTION(std::runtime_error("Cannot send message to already disconnected API client '" + GetIdentity() + "'!"));
|
||||||
}
|
}
|
||||||
|
|
||||||
Ptr keepAlive (this);
|
Ptr keepAlive (this);
|
||||||
@ -177,7 +177,7 @@ void JsonRpcConnection::SendMessage(const Dictionary::Ptr& message)
|
|||||||
void JsonRpcConnection::SendRawMessage(const String& message)
|
void JsonRpcConnection::SendRawMessage(const String& message)
|
||||||
{
|
{
|
||||||
if (m_ShuttingDown) {
|
if (m_ShuttingDown) {
|
||||||
return;
|
BOOST_THROW_EXCEPTION(std::runtime_error("Cannot send message to already disconnected API client '" + GetIdentity() + "'!"));
|
||||||
}
|
}
|
||||||
|
|
||||||
Ptr keepAlive (this);
|
Ptr keepAlive (this);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user