From: Christian Herdtweck Date: Thu, 21 May 2015 07:39:15 +0000 (+0200) Subject: fixed a bug causing failed assertions from inconsistent counts in HostStatus X-Git-Url: http://developer.intra2net.com/git/?p=pingcheck;a=commitdiff_plain;h=db625177cbfdfa0bfb0219ccd50a4b1383c65390 fixed a bug causing failed assertions from inconsistent counts in HostStatus 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 --- diff --git a/src/host/hoststatus.cpp b/src/host/hoststatus.cpp index e35f668..530171f 100644 --- a/src/host/hoststatus.cpp +++ b/src/host/hoststatus.cpp @@ -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 << "): "