]> granicus.if.org Git - icinga2/commitdiff
Fix a potential deadlock in ApiClient::Disconnect
authorGunnar Beutner <gunnar.beutner@netways.de>
Mon, 4 Aug 2014 07:50:47 +0000 (09:50 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Mon, 4 Aug 2014 07:50:47 +0000 (09:50 +0200)
refs #6724

lib/remote/apiclient.cpp
lib/remote/apiclient.hpp

index 3c6cea81e221d7921edc06e2f52a754219291fdb..813ed0b0dea0014818a0933becd5b728ec0ca1ce 100644 (file)
@@ -94,6 +94,11 @@ void ApiClient::SendMessageSync(const Dictionary::Ptr& message)
 }
 
 void ApiClient::Disconnect(void)
+{
+       Utility::QueueAsyncCallback(boost::bind(&ApiClient::DisconnectSync, this));
+}
+
+void ApiClient::DisconnectSync(void)
 {
        Log(LogWarning, "ApiClient", "API client disconnected for identity '" + m_Identity + "'");
 
index b6d87e068856f4f1d745e6fe679303f43b34143f..6f1f68074799739c97599fc127566fa3a848f615 100644 (file)
@@ -55,6 +55,7 @@ public:
        ConnectionRole GetRole(void) const;
 
        void Disconnect(void);
+       void DisconnectSync(void);
 
        void SendMessage(const Dictionary::Ptr& request);