]> granicus.if.org Git - icinga2/commitdiff
Add SetCorked() calls to the JsonRpcConnection class 6133/head
authorGunnar Beutner <gunnar.beutner@icinga.com>
Wed, 28 Feb 2018 10:42:05 +0000 (11:42 +0100)
committerGunnar Beutner <gunnar.beutner@icinga.com>
Wed, 28 Feb 2018 10:42:05 +0000 (11:42 +0100)
lib/remote/jsonrpcconnection.cpp

index c1895934c016027b6a8a1edf3612970c33888022..978cd9658d3544f7871ee9c018ddf33c9f261c0b 100644 (file)
@@ -155,6 +155,8 @@ void JsonRpcConnection::MessageHandlerWrapper(const String& jsonString)
 
        try {
                MessageHandler(jsonString);
+
+               m_Stream->SetCorked(false);
        } catch (const std::exception& ex) {
                Log(LogWarning, "JsonRpcConnection")
                        << "Error while reading JSON-RPC message for identity '" << m_Identity
@@ -255,6 +257,8 @@ bool JsonRpcConnection::ProcessMessage()
        if (srs != StatusNewItem)
                return false;
 
+       m_Stream->SetCorked(true);
+
        l_JsonRpcConnectionWorkQueues[m_ID % l_JsonRpcConnectionWorkQueueCount].Enqueue(std::bind(&JsonRpcConnection::MessageHandlerWrapper, JsonRpcConnection::Ptr(this), message));
 
        return true;