From 726febac7cd34a34a22fb857bfa87d12b9bb4f73 Mon Sep 17 00:00:00 2001 From: fyodor Date: Sun, 22 Jun 2008 21:20:10 +0000 Subject: [PATCH] add extra debugging information to an error case -- trying to track down a host discovery crash (abort) --- timing.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/timing.cc b/timing.cc index a489dc794..7dcb48eb9 100644 --- a/timing.cc +++ b/timing.cc @@ -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,