{
if ( !WantToPing )
{
- GlobalLogger.info() << LogPrefix << "waiting for ping request";
+ GlobalLogger.info() << LogPrefix << "waiting for ping request "
+ << "(should take less than " << PingIntervalInSec << "s)";
return;
}
else if ( Resolver && Resolver->is_resolving() )
else
{
uint32_t ttl = ip.get_ttl().get_updated_value();
- boost::posix_time::ptime now =
+ std::string expiry;
+ if (ttl == 0)
+ expiry = "out of date!";
+ else
+ {
+ boost::posix_time::ptime now =
boost::posix_time::second_clock::local_time();
- std::string expiry =
- boost::posix_time::to_simple_string(now + seconds(ttl));
+ expiry = boost::posix_time::to_simple_string(now + seconds(ttl));
+ }
GlobalLogger.info() << LogPrefix << "pinging IP " << ip.get_ip()
- << " with TTL " << ttl << "s (until " << expiry << ")";
+ << " with TTL " << ttl << "s (" << expiry << ")";
Ping->ping( ip.get_ip(),
DestinationPort,
boost::bind(&PingScheduler::ping_done_handler, this, _1) );
current_protocol);
// get number of up-to-date IPs
+ // TODO should check here, if they will be up to date in PingIntervalInSec
bool check_up_to_date = true;
int ip_count = Resolver->get_resolved_ip_count(check_up_to_date);
if (ip_count > 0)
{
GlobalLogger.info() << LogPrefix << "Set resolved_ip_count to "
- << ip_count << " where IPs may be outdated: " << false;
+ << ip_count << " where IPs may be outdated: " << !check_up_to_date;
HostAnalyzer.set_resolved_ip_count( ip_count );
if (Resolver->is_resolving())
ping_when_ready();
}
else
+ {
+ GlobalLogger.info() << LogPrefix
+ << "No up-to-date IPs --> start resolve";
start_resolving_ping_address();
- // set resolved_ip_count in resolve callback
+ // set resolved_ip_count will be called in resolve callback
+ }
}
void PingScheduler::start_resolving_ping_address()