Build fix for RHEL 5.3

This commit is contained in:
Gunnar Beutner 2012-05-09 13:49:26 +02:00
parent 68a4eadb54
commit 42881d4b8a
2 changed files with 6 additions and 5 deletions

View File

@ -573,14 +573,17 @@ int DiscoveryComponent::DiscoveryTimerHandler(const TimerEventArgs& tea)
ConfigCollection::Ptr endpointCollection = GetApplication()->GetConfigHive()->GetCollection("endpoint");
endpointCollection->ForEachObject(bind(&DiscoveryComponent::EndpointConfigHandler, this, _1));
map<string, ComponentDiscoveryInfo::Ptr>::iterator i;
map<string, ComponentDiscoveryInfo::Ptr>::iterator curr, i;
for (i = m_Components.begin(); i != m_Components.end(); ) {
string identity = i->first;
ComponentDiscoveryInfo::Ptr info = i->second;
curr = i;
i++;
if (info->LastSeen < now - DiscoveryComponent::RegistrationTTL) {
/* unregister this component if its registration has expired */
i = m_Components.erase(i);
m_Components.erase(curr);
continue;
}
@ -599,8 +602,6 @@ int DiscoveryComponent::DiscoveryTimerHandler(const TimerEventArgs& tea)
/* try and reconnect to this component */
endpointManager->AddConnection(info->Node, info->Service);
}
i++;
}
return 0;