fixed a bug causing failed assertions from inconsistent counts in HostStatus
authorChristian Herdtweck <christian.herdtweck@intra2net.com>
Thu, 21 May 2015 07:39:15 +0000 (09:39 +0200)
committerChristian Herdtweck <christian.herdtweck@intra2net.com>
Thu, 21 May 2015 07:39:15 +0000 (09:39 +0200)
reason was that number of IPs may change if target host is a cname that
has changed to a different end host; this is very hard to predict so
always reset counters if number of IPs changes

src/host/hoststatus.cpp

index e35f668..530171f 100644 (file)
@@ -65,6 +65,10 @@ void HostStatus::set_resolved_ip_count( const int resolved_ip_count )
 {
     BOOST_ASSERT( 1 <= resolved_ip_count );
 
+    if (resolved_ip_count != ResolvedIpCount)
+    {   // assume that the target has changed --> reset counters
+        reset_ping_counters();
+    }
     ResolvedIpCount = resolved_ip_count;
 
     GlobalLogger.notice() << "Stat(" << HostAddress << "): "