]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Refactored actions "via_headers", "forw_headers" and "asndb" to Cache Manager
authorFrancesco Chemolli <kinkie@squid-cache.org>
Wed, 9 Jul 2008 14:08:08 +0000 (16:08 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Wed, 9 Jul 2008 14:08:08 +0000 (16:08 +0200)
singleton API.

src/ACLASN.h
src/AccessLogEntry.h
src/access_log.cc
src/asn.cc
src/main.cc

index 65b4f00be9788d08ec0b70fd796cf92f380538f3..2912dc47f8cd29fbc47807f17ac7d3039e6f42e2 100644 (file)
@@ -51,7 +51,7 @@ SQUIDCEXTERN int asnMatchIp(List<int> *, IPAddress &);
 SQUIDCEXTERN void asnInit(void);
 
 /// \ingroup ACLAPI
-extern void asnRegisterWithCacheManager(CacheManager & manager);
+extern void asnRegisterWithCacheManager();
 
 /// \ingroup ACLAPI
 SQUIDCEXTERN void asnFreeMemory(void);
index 659aaa36600b29cb87528a75fe0d888ad6b9305b..9ddd12f500e279931cf64b90b989aab8d049a5fc 100644 (file)
@@ -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);
index 8e43b1229ed0966e3ed72558a0dac29273481586..7b44d7de6c3c4a14921ebea89d621a92bd4fcc5c 100644 (file)
@@ -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);
 }
 
index ce9f739adfb1723f93d348ab225ed708c6e36a59..bcd4e59fe7e762c801774cbbad5f5bcb1f619697 100644 (file)
@@ -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
index 7d4cb60887527eb6d946a43456ebe3e301a13a6a..e53e98949074b3471eb344f8420f198a067b31b9 100644 (file)
@@ -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