]> granicus.if.org Git - icinga2/commitdiff
Add SetCorked() calls to the JsonRpcConnection class
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 11:57:22 +0000 (12:57 +0100)
lib/remote/jsonrpcconnection.cpp

index 0be3fb46eb624d318af22921eaa293b0c6d40102..161a9d01521bb400410e1e0ecd6a5e7f67280574 100644 (file)
@@ -144,6 +144,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
@@ -242,6 +244,8 @@ bool JsonRpcConnection::ProcessMessage(void)
        if (srs != StatusNewItem)
                return false;
 
+       m_Stream->SetCorked(true);
+
        l_JsonRpcConnectionWorkQueues[m_ID % l_JsonRpcConnectionWorkQueueCount].Enqueue(boost::bind(&JsonRpcConnection::MessageHandlerWrapper, JsonRpcConnection::Ptr(this), message));
 
        return true;