mirror of https://github.com/Icinga/icinga2.git
Merge pull request #7841 from Icinga/bugfix/jsonrpcconnection-sendmessage-keepalive
JsonRpcConnection#Send*Message(): keep this alive
This commit is contained in:
commit
c9ab04d511
|
@ -170,12 +170,16 @@ ConnectionRole JsonRpcConnection::GetRole() const
|
||||||
|
|
||||||
void JsonRpcConnection::SendMessage(const Dictionary::Ptr& message)
|
void JsonRpcConnection::SendMessage(const Dictionary::Ptr& message)
|
||||||
{
|
{
|
||||||
m_IoStrand.post([this, message]() { SendMessageInternal(message); });
|
Ptr keepAlive (this);
|
||||||
|
|
||||||
|
m_IoStrand.post([this, keepAlive, message]() { SendMessageInternal(message); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void JsonRpcConnection::SendRawMessage(const String& message)
|
void JsonRpcConnection::SendRawMessage(const String& message)
|
||||||
{
|
{
|
||||||
m_IoStrand.post([this, message]() {
|
Ptr keepAlive (this);
|
||||||
|
|
||||||
|
m_IoStrand.post([this, keepAlive, message]() {
|
||||||
m_OutgoingMessagesQueue.emplace_back(message);
|
m_OutgoingMessagesQueue.emplace_back(message);
|
||||||
m_OutgoingMessagesQueued.Set();
|
m_OutgoingMessagesQueued.Set();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue