]> granicus.if.org Git - icinga2/commitdiff
Fixed problem with keeping subscriptions properly synchronized.
authorGunnar Beutner <gunnar.beutner@netways.de>
Mon, 2 Jul 2012 09:19:14 +0000 (11:19 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Mon, 2 Jul 2012 09:19:14 +0000 (11:19 +0200)
icinga/endpointmanager.cpp

index 04f1face14b3223c7cb3c5651d202228db708aad..7230c228130cd69fe47809ffdc63ad7634cccd28 100644 (file)
@@ -172,6 +172,21 @@ void EndpointManager::RegisterEndpoint(Endpoint::Ptr endpoint)
        } else {
                m_PendingEndpoints.push_back(endpoint);
        }
+
+       if (endpoint->IsLocal()) {
+               /* this endpoint might have introduced new subscriptions
+                * or publications which affect remote endpoints, we need
+                * to close all fully-connected remote endpoints to make sure
+                * these subscriptions/publications are kept up-to-date. */
+               Iterator prev, it;
+               for (it = m_Endpoints.begin(); it != m_Endpoints.end(); ) {
+                       prev = it;
+                       it++;
+
+                       if (!prev->second->IsLocal())
+                               m_Endpoints.erase(prev);
+               }
+       }
 }
 
 /**