1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

add extra debugging information to an error case -- trying to track down a host discovery crash (abort)

This commit is contained in:
fyodor
2008-06-22 21:20:10 +00:00
parent 49a919f401
commit 726febac7c

View File

@@ -336,7 +336,8 @@ void RateMeter::update(u32 packets, u32 bytes, const struct timeval *now) {
/* How long since the last update? */
diff = TIMEVAL_SUBTRACT(*now, last_update_tv) / 1000000.0;
assert(diff >= 0.0);
if (diff < 0.0)
fatal("RateMeter::update: negative time delta; now=%lu.%lu; last_update_tv=%lu.%lu", (unsigned long) now->tv_sec, (unsigned long) now->tv_usec, (unsigned long) last_update_tv.tv_sec, (unsigned long) last_update_tv.tv_usec);
/* Find out how far back in time to look. We want to look back
CURRENT_RATE_HISTORY seconds, or to when the last update occurred,