=== modified file 'a/src/ICAP/ICAPConfig.cc' --- a/src/ICAP/ICAPConfig.cc +++ b/src/ICAP/ICAPConfig.cc @@ -34,8 +34,8 @@ #include "squid.h" +#include "ACL.h" #include "ConfigParser.h" -#include "ACL.h" #include "Store.h" #include "Array.h" // really Vector #include "ICAPConfig.h" @@ -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 @@ }; void -ICAPConfig::parseICAPAccess() +ICAPConfig::parseICAPAccess(ConfigParser &parser) { String aKey; ConfigParser::ParseString(&aKey); @@ -362,7 +360,7 @@ 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 === modified file 'a/src/ICAP/ICAPConfig.h' --- a/src/ICAP/ICAPConfig.h +++ b/src/ICAP/ICAPConfig.h @@ -39,6 +39,8 @@ #include "ICAPServiceRep.h" class acl_access; + +class ConfigParser; class ICAPConfig; @@ -116,7 +118,7 @@ void freeICAPClass(void); void dumpICAPClass(StoreEntry *, const char *); - void parseICAPAccess(void); + void parseICAPAccess(ConfigParser &parser); void freeICAPAccess(void); void dumpICAPAccess(StoreEntry *, const char *); === modified file 'a/src/cache_cf.cc' --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -145,8 +145,12 @@ #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(); +/* 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 +3264,7 @@ static void parse_icap_access_type(ICAPConfig * cfg) { - cfg->parseICAPAccess(); + cfg->parseICAPAccess(LegacyParser); } static void