]> granicus.if.org Git - icinga2/commitdiff
Bugfix: Connecting to a remote node crashes Icinga2.
authorGunnar Beutner <gunnar.beutner@netways.de>
Thu, 11 Oct 2012 12:17:40 +0000 (14:17 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Thu, 11 Oct 2012 12:17:40 +0000 (14:17 +0200)
lib/remoting/endpointmanager.cpp

index 080f46aa0296e178ac4a6dfab82f2c861fd4878f..a0cb240e8f8320abd213614fd3e0588cc1d4c5ea 100644 (file)
@@ -147,8 +147,6 @@ void EndpointManager::NewClientHandler(const TcpClient::Ptr& client)
 {
        JsonRpcClient::Ptr jclient = static_pointer_cast<JsonRpcClient>(client);
 
-       Logger::Write(LogInformation, "icinga", "New client connection from " + jclient->GetPeerAddress());
-
        m_PendingClients.insert(jclient);
        jclient->OnConnected.connect(boost::bind(&EndpointManager::ClientConnectedHandler, this, _1));
        jclient->Start();
@@ -158,6 +156,8 @@ void EndpointManager::ClientConnectedHandler(const TcpClient::Ptr& client)
 {
        JsonRpcClient::Ptr jclient = static_pointer_cast<JsonRpcClient>(client);
 
+       Logger::Write(LogInformation, "icinga", "New client connection for " + jclient->GetPeerAddress());
+
        m_PendingClients.erase(jclient);
 
        shared_ptr<X509> cert = jclient->GetPeerCertificate();