From bf1e07b686fb313b0b55e2d1b2e6d79d14526df5 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Fri, 20 Apr 2012 16:44:32 +0200 Subject: [PATCH] Bugfix for reconnection handling. --- base/application.cpp | 6 +++--- icinga/jsonrpcendpoint.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/base/application.cpp b/base/application.cpp index 20ba6561c..aab9f8e8f 100644 --- a/base/application.cpp +++ b/base/application.cpp @@ -125,13 +125,13 @@ void Application::RunEventLoop(void) int fd = socket->GetFD(); - if (FD_ISSET(fd, &writefds)) + if (FD_ISSET(fd, &writefds) && socket->GetFD() != INVALID_SOCKET) socket->OnWritable(ea); - if (FD_ISSET(fd, &readfds)) + if (FD_ISSET(fd, &readfds) && socket->GetFD() != INVALID_SOCKET) socket->OnReadable(ea); - if (FD_ISSET(fd, &exceptfds)) + if (FD_ISSET(fd, &exceptfds) && socket->GetFD() != INVALID_SOCKET) socket->OnException(ea); } } diff --git a/icinga/jsonrpcendpoint.cpp b/icinga/jsonrpcendpoint.cpp index ee19dad82..c6019d920 100644 --- a/icinga/jsonrpcendpoint.cpp +++ b/icinga/jsonrpcendpoint.cpp @@ -97,7 +97,7 @@ int JsonRpcEndpoint::ClientClosedHandler(const EventArgs& ea) ClearMethodSinks(); ClearMethodSources(); - if (CountMethodSinks() == 0) + if (CountMethodSinks() == 0 && !m_ReconnectTimer) GetEndpointManager()->UnregisterEndpoint(static_pointer_cast(shared_from_this())); m_Client.reset();