From: Francesco Chemolli Date: Fri, 11 Jul 2008 19:11:44 +0000 (+0200) Subject: More cache manager initialization calls reshuffling. X-Git-Tag: SQUID_3_1_0_1~49^2~143^2~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d120ed12ae4835bca7d850d00749978956126f55;p=thirdparty%2Fsquid.git More cache manager initialization calls reshuffling. --- diff --git a/src/ProfStats.cc b/src/ProfStats.cc index eb9506fa8f..74cafb185d 100644 --- a/src/ProfStats.cc +++ b/src/ProfStats.cc @@ -269,6 +269,8 @@ static hrtime_t now; static void xprof_Init(void) { + xprofRegisterWithCacheManager(); + if (xprof_inited) return; diff --git a/src/ipcache.cc b/src/ipcache.cc index 6f2045cf49..2564723d9a 100644 --- a/src/ipcache.cc +++ b/src/ipcache.cc @@ -806,6 +806,8 @@ ipcache_init(void) n = hashPrime(ipcache_high / 4); ip_table = hash_create((HASHCMP *) strcmp, n, hash4); memDataInit(MEM_IPCACHE_ENTRY, "ipcache_entry", sizeof(ipcache_entry), 0); + + ipcacheRegisterWithCacheManager(); } /// \ingroup IPCacheAPI diff --git a/src/main.cc b/src/main.cc index 6694e5260b..3461bfcc97 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1010,25 +1010,24 @@ mainInitialize(void) idnsRegisterWithCacheManager(); #endif - ipcacheRegisterWithCacheManager(); + // ipcacheRegisterWithCacheManager(); //moved to ipcache_init() Mem::RegisterWithCacheManager(); - netdbRegisterWitHCacheManager(); + // netdbRegisterWitHCacheManager(); //moved to netdbInit() PconnModule::GetInstance()->registerWithCacheManager(); - redirectRegisterWithCacheManager(); - refreshRegisterWithCacheManager(); - statRegisterWithCacheManager(); - storeDigestRegisterWithCacheManager(); + // redirectRegisterWithCacheManager(); //moved to redirectInit() + // refreshRegisterWithCacheManager(); //moved to refreshInit() + // statRegisterWithCacheManager(); //moved to statInit() + // storeDigestRegisterWithCacheManager(); //moved to storeDigestInit() StoreFileSystem::RegisterAllFsWithCacheManager(); - storeRegisterWithCacheManager(); + // storeRegisterWithCacheManager(); //moved to storeInit() storeLogRegisterWithCacheManager(); #if DEBUGSTRINGS StringRegistry::Instance().registerWithCacheManager(); #endif -#if USE_XPROF_STATS - - xprofRegisterWithCacheManager(); +#if USE_XPROF_STATS + // xprofRegisterWithCacheManager(); //moved to xprof_init() #endif } diff --git a/src/net_db.cc b/src/net_db.cc index 06f18c77f1..fe38729b02 100644 --- a/src/net_db.cc +++ b/src/net_db.cc @@ -894,6 +894,8 @@ netdbInit(void) #if USE_ICMP int n; + netdbRegisterWitHCacheManager(); + if (addr_table) return; diff --git a/src/redirect.cc b/src/redirect.cc index ccae37073d..e5c311cf55 100644 --- a/src/redirect.cc +++ b/src/redirect.cc @@ -181,6 +181,8 @@ redirectInit(void) { static int init = 0; + redirectRegisterWithCacheManager(); + if (!Config.Program.redirect) return; diff --git a/src/refresh.cc b/src/refresh.cc index ddd3e686dd..399023b0a7 100644 --- a/src/refresh.cc +++ b/src/refresh.cc @@ -596,6 +596,8 @@ refreshInit(void) DefaultRefresh.min = REFRESH_DEFAULT_MIN; DefaultRefresh.pct = REFRESH_DEFAULT_PCT; DefaultRefresh.max = REFRESH_DEFAULT_MAX; + + refreshRegisterWithCacheManager(); } void diff --git a/src/stat.cc b/src/stat.cc index f9b2649142..c73fd0edd6 100644 --- a/src/stat.cc +++ b/src/stat.cc @@ -1026,6 +1026,8 @@ statInit(void) ClientActiveRequests.head = NULL; ClientActiveRequests.tail = NULL; + + statRegisterWithCacheManager(); } void diff --git a/src/store.cc b/src/store.cc index f22c4cba50..0463a19977 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1397,6 +1397,8 @@ storeInit(void) eventAdd("storeLateRelease", storeLateRelease, NULL, 1.0, 1); Store::Root().init(); storeRebuildStart(); + + storeRegisterWithCacheManager(); } void diff --git a/src/store_digest.cc b/src/store_digest.cc index 8185bbad84..01e131fdf1 100644 --- a/src/store_digest.cc +++ b/src/store_digest.cc @@ -108,6 +108,8 @@ static void storeDigestAdd(const StoreEntry *); void storeDigestInit(void) { + storeDigestRegisterWithCacheManager(); + #if USE_CACHE_DIGESTS const int cap = storeDigestCalcCap();