From: Gunnar Beutner Date: Fri, 20 Apr 2012 14:44:32 +0000 (+0200) Subject: Bugfix for reconnection handling. X-Git-Tag: v0.0.1~606 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bf1e07b686fb313b0b55e2d1b2e6d79d14526df5;p=icinga2 Bugfix for reconnection handling. --- 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();