]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
cosmetic fix: cachemgr memory stats report absurd "high (hrs)"
authorwessels <>
Thu, 15 Sep 2005 05:20:14 +0000 (05:20 +0000)
committerwessels <>
Thu, 15 Sep 2005 05:20:14 +0000 (05:20 +0000)
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.

include/memMeter.h

index 1a3bc6cc1c151bc24ee6b87f4d0fd95c98858457..095c7df13823079d6c0310939c6cd1d6e242fb14 100644 (file)
@@ -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--; }