From: Gunnar Beutner Date: Thu, 21 Jun 2012 17:52:21 +0000 (+0200) Subject: Fixed infinite loop. X-Git-Tag: v0.0.1~379 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1d7a3f6c754e77282547ecef39b7524a7eeb3e7f;p=icinga2 Fixed infinite loop. --- diff --git a/components/discovery/discoverycomponent.cpp b/components/discovery/discoverycomponent.cpp index 263827a38..a841233ae 100644 --- a/components/discovery/discoverycomponent.cpp +++ b/components/discovery/discoverycomponent.cpp @@ -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);