From 4e5702e31da81fdc72246c7ed5f0057775488171 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 11 Oct 2012 14:17:40 +0200 Subject: [PATCH] Bugfix: Connecting to a remote node crashes Icinga2. --- lib/remoting/endpointmanager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/remoting/endpointmanager.cpp b/lib/remoting/endpointmanager.cpp index 080f46aa0..a0cb240e8 100644 --- a/lib/remoting/endpointmanager.cpp +++ b/lib/remoting/endpointmanager.cpp @@ -147,8 +147,6 @@ void EndpointManager::NewClientHandler(const TcpClient::Ptr& client) { JsonRpcClient::Ptr jclient = static_pointer_cast(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(client); + Logger::Write(LogInformation, "icinga", "New client connection for " + jclient->GetPeerAddress()); + m_PendingClients.erase(jclient); shared_ptr cert = jclient->GetPeerCertificate();