]> granicus.if.org Git - icinga2/commitdiff
Fixed infinite loop.
authorGunnar Beutner <gunnar.beutner@netways.de>
Thu, 21 Jun 2012 17:52:21 +0000 (19:52 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Thu, 21 Jun 2012 17:52:21 +0000 (19:52 +0200)
components/discovery/discoverycomponent.cpp

index 263827a38655360651ddd98b703392d2e6eafa9e..a841233aea3ec3a4fa57df86ff161c42b0705c67 100644 (file)
@@ -483,6 +483,9 @@ void DiscoveryComponent::DiscoveryTimerHandler(void)
                string identity = i->first;
                ComponentDiscoveryInfo::Ptr info = i->second;
 
+               curr = i;
+               i++;
+
                /* there's no need to reconnect to ourself */
                if (identity == GetEndpointManager()->GetIdentity())
                        continue;
@@ -493,9 +496,6 @@ void DiscoveryComponent::DiscoveryTimerHandler(void)
                if (ConfigObject::GetObject("endpoint", identity))
                        continue;
 
-               curr = i;
-               i++;
-
                if (info->LastSeen < now - DiscoveryComponent::RegistrationTTL) {
                        /* unregister this component if its registration has expired */
                        m_Components.erase(curr);