]> granicus.if.org Git - icinga2/commitdiff
Bugfix for reconnection handling.
authorGunnar Beutner <gunnar.beutner@netways.de>
Fri, 20 Apr 2012 14:44:32 +0000 (16:44 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Fri, 20 Apr 2012 14:44:32 +0000 (16:44 +0200)
base/application.cpp
icinga/jsonrpcendpoint.cpp

index 20ba6561cf6ce4ee515878a3429a3aec8126c4c3..aab9f8e8f42ba5dfa12c08eb3f6e5c2e6d8891b7 100644 (file)
@@ -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);
                }
        }
index ee19dad82979ce92d1edcfe9bc4f7532693a37fd..c6019d920de1724331858c7d47ecf9870021ed27 100644 (file)
@@ -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<Endpoint>(shared_from_this()));
 
        m_Client.reset();