]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
bug1933 fix: Fixed memory pools configuration reporting.
authorrousskov <>
Wed, 23 Jan 2008 00:13:36 +0000 (00:13 +0000)
committerrousskov <>
Wed, 23 Jan 2008 00:13:36 +0000 (00:13 +0000)
We used to report too early, before Squid configuration was parsed.

src/Mem.h
src/main.cc
src/mem.cc

index 22f7d44c7bd478105259bd0c8f9b031c1880b536..92653165c9fd9c4492070374aa7131d2268581eb 100644 (file)
--- a/src/Mem.h
+++ b/src/Mem.h
@@ -1,6 +1,6 @@
 
 /*
- * $Id: Mem.h,v 1.4 2006/05/29 00:15:01 robertc Exp $
+ * $Id: Mem.h,v 1.5 2008/01/22 17:13:36 rousskov Exp $
  *
  * DEBUG: section 13    High Level Memory Pool Management
  * AUTHOR: Harvest Derived
@@ -47,6 +47,7 @@ class Mem
 
 public:
     static void Init();
+    static void Report();
     static void RegisterWithCacheManager(CacheManager & manager);
     static void Stats(StoreEntry *);
     static void CleanIdlePools(void *unused);
index b4a53f36e550d48db5e17a11a418725a9a9ad2cb..183b0040c532d9f67b97511199b9f425e325ac17 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: main.cc,v 1.454 2007/12/29 18:32:31 hno Exp $
+ * $Id: main.cc,v 1.455 2008/01/22 17:13:36 rousskov Exp $
  *
  * DEBUG: section 1     Startup and Main Loop
  * AUTHOR: Harvest Derived
@@ -636,6 +636,7 @@ mainReconfigure(void)
     errorClean();
     enter_suid();              /* root to read config file */
     parseConfigFile(ConfigFile, manager);
+    Mem::Report();
     setEffectiveUser();
     _db_init(Config.Log.log, Config.debugOptions);
     ipcache_restart();         /* clear stuck entries */
@@ -1192,6 +1193,8 @@ main(int argc, char **argv)
 
         parse_err = parseConfigFile(ConfigFile, manager);
 
+        Mem::Report();
+        
         if (opt_parse_cfg_only)
 
             return parse_err;
index 8e253ec7da12b2fa9402ac39ab7b7a9decca6c78..8d4b005243db8cbe7254ebf2da732048c5738eeb 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: mem.cc,v 1.106 2007/11/15 16:47:35 wessels Exp $
+ * $Id: mem.cc,v 1.107 2008/01/22 17:13:36 rousskov Exp $
  *
  * DEBUG: section 13    High Level Memory Pool Management
  * AUTHOR: Harvest Derived
@@ -382,8 +382,6 @@ Mem::Init(void)
      * debug messages here at level 0 or 1 will always be printed
      * on stderr.
      */
-    debugs(13, 3, "Memory pools are '" << ((Config.onoff.mem_pools ? "on" : "off"))  << "'; limit: "<<
-            std::setprecision(3) << toMB(MemPools::GetInstance().idleLimit()) << " MB");
 
     /* set all pointers to null */
     memset(MemPools, '\0', sizeof(MemPools));
@@ -430,6 +428,15 @@ Mem::Init(void)
     }
 }
 
+void
+Mem::Report()
+{
+    debugs(13, 3, "Memory pools are '" <<
+        (Config.onoff.mem_pools ? "on" : "off")  << "'; limit: " <<
+        std::setprecision(3) << toMB(MemPools::GetInstance().idleLimit()) <<
+        " MB");
+}
+
 void
 Mem::RegisterWithCacheManager(CacheManager & manager)
 {