]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Moved action "config" to singleton API.
authorFrancesco Chemolli <kinkie@squid-cache.org>
Wed, 9 Jul 2008 13:51:36 +0000 (15:51 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Wed, 9 Jul 2008 13:51:36 +0000 (15:51 +0200)
src/ConfigParser.h
src/cache_cf.cc
src/main.cc

index 7e12eb6ecbb386dc036c14157ac80e560a4a36dc..20055bbb4f430eeab490b8e4c837df5a1e356e26 100644 (file)
 
 #include "squid.h"
 
-/* forward decls */
-
-class CacheManager;
-
 /*
  * A configuration file Parser. Instances of this class track
  * parsing state and perform tokenisation. Syntax is currently
@@ -66,6 +62,6 @@ public:
     static char * strtokFile();
 };
 
-extern int parseConfigFile(const char *file_name, CacheManager & manager);
+extern int parseConfigFile(const char *file_name);
 
 #endif /* SQUID_CONFIGPARSER_H */
index f845cf2f2c1ca12a4f191bb90a3566055ddb1baa..59a28d139a683156f281c5d1405daf87f9a6d77d 100644 (file)
@@ -382,9 +382,10 @@ parseOneConfigFile(const char *file_name, unsigned int depth)
 }
 
 int
-parseConfigFile(const char *file_name, CacheManager & manager)
+parseConfigFile(const char *file_name)
 {
     int err_count = 0;
+    CacheManager *manager=CacheManager::GetInstance();
 
     configFreeMemory();
 
@@ -409,7 +410,7 @@ parseConfigFile(const char *file_name, CacheManager & manager)
     }
 
     if (opt_send_signal == -1) {
-        manager.registerAction("config",
+        manager->registerAction("config",
                                "Current Squid Configuration",
                                dump_config,
                                1, 1);
index 3de422ca003447a31fb17930dafa29e0177dded2..72999d2d490afcfefe5c15be5e170d48dd3a2115 100644 (file)
@@ -694,7 +694,7 @@ mainReconfigure(void)
     refererCloseLog();
     errorClean();
     enter_suid();              /* root to read config file */
-    parseConfigFile(ConfigFile, *manager);
+    parseConfigFile(ConfigFile);
     setUmask(Config.umask);
     Mem::Report();
     setEffectiveUser();
@@ -1263,7 +1263,7 @@ main(int argc, char **argv)
         /* we may want the parsing process to set this up in the future */
         Store::Root(new StoreController);
 
-        parse_err = parseConfigFile(ConfigFile, *manager);
+        parse_err = parseConfigFile(ConfigFile);
 
         Mem::Report();