From 1d7a3f6c754e77282547ecef39b7524a7eeb3e7f Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 21 Jun 2012 19:52:21 +0200 Subject: [PATCH] Fixed infinite loop. --- components/discovery/discoverycomponent.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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); -- 2.50.1