From: Francesco Chemolli Date: Wed, 9 Jul 2008 14:08:08 +0000 (+0200) Subject: Refactored actions "via_headers", "forw_headers" and "asndb" to Cache Manager X-Git-Tag: SQUID_3_1_0_1~49^2~143^2~36 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d62a240ca57001bd91a23906757b05dbbc34b539;p=thirdparty%2Fsquid.git Refactored actions "via_headers", "forw_headers" and "asndb" to Cache Manager singleton API. --- diff --git a/src/ACLASN.h b/src/ACLASN.h index 65b4f00be9..2912dc47f8 100644 --- a/src/ACLASN.h +++ b/src/ACLASN.h @@ -51,7 +51,7 @@ SQUIDCEXTERN int asnMatchIp(List *, IPAddress &); SQUIDCEXTERN void asnInit(void); /// \ingroup ACLAPI -extern void asnRegisterWithCacheManager(CacheManager & manager); +extern void asnRegisterWithCacheManager(); /// \ingroup ACLAPI SQUIDCEXTERN void asnFreeMemory(void); diff --git a/src/AccessLogEntry.h b/src/AccessLogEntry.h index 659aaa3660..9ddd12f500 100644 --- a/src/AccessLogEntry.h +++ b/src/AccessLogEntry.h @@ -144,7 +144,7 @@ extern void accessLogLog(AccessLogEntry *, ACLChecklist * checklist); extern void accessLogRotate(void); extern void accessLogClose(void); extern void accessLogInit(void); -extern void accessLogRegisterWithCacheManager(CacheManager & manager); +extern void accessLogRegisterWithCacheManager(); extern void accessLogFreeMemory(AccessLogEntry * aLogEntry); extern const char *accessLogTime(time_t); extern int accessLogParseLogFormat(logformat_token ** fmt, char *def); diff --git a/src/access_log.cc b/src/access_log.cc index 8e43b1229e..7b44d7de6c 100644 --- a/src/access_log.cc +++ b/src/access_log.cc @@ -105,7 +105,7 @@ static OBJH fvdbDumpVia; static OBJH fvdbDumpForw; static FREE fvdbFreeEntry; static void fvdbClear(void); -static void fvdbRegisterWithCacheManager(CacheManager & manager); +static void fvdbRegisterWithCacheManager(); #endif static int LogfileStatus = LOG_DISABLE; @@ -1611,11 +1611,11 @@ accessLogInit(void) } void -accessLogRegisterWithCacheManager(CacheManager & manager) +accessLogRegisterWithCacheManager() { #if FORW_VIA_DB - fvdbRegisterWithCacheManager(manager); + fvdbRegisterWithCacheManager(); #endif } @@ -1648,10 +1648,11 @@ fvdbInit(void) } static void -fvdbRegisterWithCacheManager(CacheManager & manager) +fvdbRegisterWithCacheManager() { - manager.registerAction("via_headers", "Via Request Headers", fvdbDumpVia, 0, 1); - manager.registerAction("forw_headers", "X-Forwarded-For Request Headers", + CacheManager *manager=CacheManager::GetInstance(); + manager->registerAction("via_headers", "Via Request Headers", fvdbDumpVia, 0, 1); + manager->registerAction("forw_headers", "X-Forwarded-For Request Headers", fvdbDumpForw, 0, 1); } diff --git a/src/asn.cc b/src/asn.cc index ce9f739adf..bcd4e59fe7 100644 --- a/src/asn.cc +++ b/src/asn.cc @@ -198,9 +198,9 @@ asnInit(void) } void -asnRegisterWithCacheManager(CacheManager & manager) +asnRegisterWithCacheManager() { - manager.registerAction("asndb", "AS Number Database", asnStats, 0, 1); + CacheManager::GetInstance()->registerAction("asndb", "AS Number Database", asnStats, 0, 1); } void diff --git a/src/main.cc b/src/main.cc index 7d4cb60887..e53e989490 100644 --- a/src/main.cc +++ b/src/main.cc @@ -967,8 +967,8 @@ mainInitialize(void) FwdState::initModule(); /* register the modules in the cache manager menus */ - accessLogRegisterWithCacheManager(*manager); - asnRegisterWithCacheManager(*manager); + accessLogRegisterWithCacheManager(); + asnRegisterWithCacheManager(); authenticateRegisterWithCacheManager(&Config.authConfiguration, *manager); #if USE_CARP