From: wessels <> Date: Thu, 15 Sep 2005 05:20:14 +0000 (+0000) Subject: cosmetic fix: cachemgr memory stats report absurd "high (hrs)" X-Git-Tag: SQUID_3_0_PRE4~622 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=310a67adda13225d1c9d102b8f89e3a14878aec1;p=thirdparty%2Fsquid.git cosmetic fix: cachemgr memory stats report absurd "high (hrs)" values for some pools because those pools are constructed before squid_curtime is set. This patch calls time(NULL) in the memMeterSyncHWater() macro if squid_curtime is zero. --- diff --git a/include/memMeter.h b/include/memMeter.h index 1a3bc6cc1c..095c7df138 100644 --- a/include/memMeter.h +++ b/include/memMeter.h @@ -11,7 +11,7 @@ class MemMeter { time_t hwater_stamp; /* timestamp of last high water mark change */ }; -#define memMeterSyncHWater(m) { (m).hwater_level = (m).level; (m).hwater_stamp = squid_curtime; } +#define memMeterSyncHWater(m) { (m).hwater_level = (m).level; (m).hwater_stamp = squid_curtime ? squid_curtime : time(NULL); } #define memMeterCheckHWater(m) { if ((m).hwater_level < (m).level) memMeterSyncHWater((m)); } #define memMeterInc(m) { (m).level++; memMeterCheckHWater(m); } #define memMeterDec(m) { (m).level--; }