Fixed infinite loop.

This commit is contained in:
Gunnar Beutner 2012-06-21 19:52:21 +02:00
parent 7ed19cd533
commit 1d7a3f6c75
1 changed files with 3 additions and 3 deletions

View 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);