From: Christian Herdtweck Date: Wed, 20 May 2015 15:20:50 +0000 (+0200) Subject: fixed bug: correctly handle case when never had any IP and DNS fails X-Git-Url: http://developer.intra2net.com/git/?p=pingcheck;a=commitdiff_plain;h=b44a5f96f1769c74123f84f687a2030e3f79b524 fixed bug: correctly handle case when never had any IP and DNS fails --- diff --git a/src/host/pingscheduler.cpp b/src/host/pingscheduler.cpp index 664ad14..179a70b 100644 --- a/src/host/pingscheduler.cpp +++ b/src/host/pingscheduler.cpp @@ -199,14 +199,10 @@ void PingScheduler::ping_when_ready() ip = Resolver->get_next_ip(check_up_to_date); } if ( !ip.is_valid() ) - { // still no valid IP --> should not happen - GlobalLogger.error() << LogPrefix << "Not even outdated IP to ping " - << "-- this should not have happened!! Treat like a failed ping."; - if (DnsMaster::get_instance()->get_resolved_ip_ttl_threshold() > 0) - GlobalLogger.warning() << LogPrefix << "This probably happened " - << "because you specified a TTL threshold > 0 but resolving" - << " had no effect on TTLs since external cache is only " - << "updated when TTL=0 is reached."; + { // Do not even have an outdated IP! + // This happens if have no cached IPs and resolve failed + GlobalLogger.info() << LogPrefix << "Not even outdated IP to ping " + << "-- treat like a failed ping."; // skip the ping and directly call ping_done_handler ping_done_handler(false);