mirror of https://github.com/Icinga/icinga2.git
Build fix for RHEL 5.3
This commit is contained in:
parent
68a4eadb54
commit
42881d4b8a
|
@ -573,14 +573,17 @@ int DiscoveryComponent::DiscoveryTimerHandler(const TimerEventArgs& tea)
|
||||||
ConfigCollection::Ptr endpointCollection = GetApplication()->GetConfigHive()->GetCollection("endpoint");
|
ConfigCollection::Ptr endpointCollection = GetApplication()->GetConfigHive()->GetCollection("endpoint");
|
||||||
endpointCollection->ForEachObject(bind(&DiscoveryComponent::EndpointConfigHandler, this, _1));
|
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(); ) {
|
for (i = m_Components.begin(); i != m_Components.end(); ) {
|
||||||
string identity = i->first;
|
string identity = i->first;
|
||||||
ComponentDiscoveryInfo::Ptr info = i->second;
|
ComponentDiscoveryInfo::Ptr info = i->second;
|
||||||
|
|
||||||
|
curr = i;
|
||||||
|
i++;
|
||||||
|
|
||||||
if (info->LastSeen < now - DiscoveryComponent::RegistrationTTL) {
|
if (info->LastSeen < now - DiscoveryComponent::RegistrationTTL) {
|
||||||
/* unregister this component if its registration has expired */
|
/* unregister this component if its registration has expired */
|
||||||
i = m_Components.erase(i);
|
m_Components.erase(curr);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -599,8 +602,6 @@ int DiscoveryComponent::DiscoveryTimerHandler(const TimerEventArgs& tea)
|
||||||
/* try and reconnect to this component */
|
/* try and reconnect to this component */
|
||||||
endpointManager->AddConnection(info->Node, info->Service);
|
endpointManager->AddConnection(info->Node, info->Service);
|
||||||
}
|
}
|
||||||
|
|
||||||
i++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue