]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Robert's patch to correct my LegacyParser abuse.
authorwessels <>
Fri, 28 Apr 2006 11:05:43 +0000 (11:05 +0000)
committerwessels <>
Fri, 28 Apr 2006 11:05:43 +0000 (11:05 +0000)
src/ICAP/ICAPConfig.cc
src/ICAP/ICAPConfig.h
src/cache_cf.cc

index 49381ac9d29af3e9a5cde06c0ff50f0e245b5b47..57b65061a1aa23c09c938f527ac252964c8ad62f 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ICAPConfig.cc,v 1.9 2006/04/27 19:27:37 wessels Exp $
+ * $Id: ICAPConfig.cc,v 1.10 2006/04/28 05:05:47 wessels Exp $
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
  * ----------------------------------------------------------
@@ -45,9 +45,7 @@
 #include "ACLChecklist.h"
 #include "wordlist.h"
 
-extern ConfigParser LegacyParser;      // from cache_cf.cc
 ICAPConfig TheICAPConfig;
-extern ConfigParser LegacyParser;      // found in cache_cf.cc
 
 ICAPServiceRep::Pointer
 ICAPConfig::findService(const String& key)
@@ -352,7 +350,7 @@ ICAPConfig::dumpICAPClass(StoreEntry *entry, const char *name)
 };
 
 void
-ICAPConfig::parseICAPAccess()
+ICAPConfig::parseICAPAccess(ConfigParser &parser)
 {
     String aKey;
     ConfigParser::ParseString(&aKey);
@@ -362,7 +360,7 @@ ICAPConfig::parseICAPAccess()
         fatalf("Did not find ICAP class '%s' referenced on line %d\n",
                aKey.buf(), config_lineno);
 
-    aclParseAccessLine(LegacyParser, &theClass->accessList);
+    aclParseAccessLine(parser, &theClass->accessList);
 };
 
 void
index e7e0731802b2db76a91641299c87ab1daa1ab22d..007835c57911caaf2d9ef9c44d6e36a8ef4bd343 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ICAPConfig.h,v 1.7 2005/12/22 23:52:28 wessels Exp $
+ * $Id: ICAPConfig.h,v 1.8 2006/04/28 05:05:47 wessels Exp $
  *
  *
  * SQUID Web Proxy Cache          http://www.squid-cache.org/
@@ -40,6 +40,8 @@
 
 class acl_access;
 
+class ConfigParser;
+
 class ICAPConfig;
 
 class ICAPClass
@@ -116,7 +118,7 @@ public:
     void freeICAPClass(void);
     void dumpICAPClass(StoreEntry *, const char *);
 
-    void parseICAPAccess(void);
+    void parseICAPAccess(ConfigParser &parser);
     void freeICAPAccess(void);
     void dumpICAPAccess(StoreEntry *, const char *);
 
index db63ce265093b8f00eed1355da094ae251e3918a..431b00eb658cac8b9b94a4bc4c02fd79d5e8a021 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cache_cf.cc,v 1.493 2006/04/27 20:36:29 hno Exp $
+ * $Id: cache_cf.cc,v 1.494 2006/04/28 05:05:43 wessels Exp $
  *
  * DEBUG: section 3     Configuration File Parsing
  * AUTHOR: Harvest Derived
@@ -145,8 +145,13 @@ static int check_null_https_port_list(const https_port_list *);
 #endif /* USE_SSL */
 static void parse_b_size_t(size_t * var);
 
-/* a parser for legacy code that uses the global approach */
-ConfigParser LegacyParser = ConfigParser();
+/*
+ * LegacyParser is a parser for legacy code that uses the global
+ * approach.  This is static so that it is only exposed to cache_cf.
+ * Other modules needing access to a ConfigParser should have it
+ * provided to them in their parserFOO methods.
+ */
+static ConfigParser LegacyParser = ConfigParser();
 
 void
 self_destruct(void)
@@ -3260,7 +3265,7 @@ dump_icap_class_type(StoreEntry * entry, const char *name, ICAPConfig cfg)
 static void
 parse_icap_access_type(ICAPConfig * cfg)
 {
-    cfg->parseICAPAccess();
+    cfg->parseICAPAccess(LegacyParser);
 }
 
 static void