*list = NULL;
}
-
-/*
- * This function traverses all ACL elements referenced
- * by an access list (presumably 'http_access'). If
- * it finds a PURGE method ACL, then it returns TRUE,
- * otherwise FALSE.
- */
-/* XXX: refactor this more sensibly. perhaps have the parser detect it ? */
-int
-aclPurgeMethodInUse(acl_access * a)
-{
- ACLList *b;
-
- debugs(28, 6, "aclPurgeMethodInUse: invoked for '" << a->cfgline << "'");
-
- for (; a; a = a->next) {
- for (b = a->aclList; b; b = b->next) {
- ACLStrategised<HttpRequestMethod> *tempAcl = dynamic_cast<ACLStrategised<HttpRequestMethod> *>(b->_acl);
-
- if (!tempAcl) {
- debugs(28, 7, "aclPurgeMethodInUse: can't create tempAcl");
- continue;
- }
-
- if (tempAcl->match(METHOD_PURGE)) {
- debugs(28, 6, "aclPurgeMethodInUse: returning true");
- return true;
- }
- }
- }
-
- debugs(28, 6, "aclPurgeMethodInUse: returning false");
- return false;
-}
extern void aclCacheMatchFlush(dlink_list * cache);
/// \ingroup ACLAPI
extern void dump_acl_access(StoreEntry * entry, const char *name, acl_access * head);
-/// \ingroup ACLAPI
-int aclPurgeMethodInUse(acl_access * a);
#endif /* SQUID_ACL_GADGETS_H */
for (Tail = &values; *Tail; Tail = &((*Tail)->next));
while ((t = strtokFile())) {
+ if(strcmp(t, "PURGE") == 0) {
+ // we need to use PURGE, can't just blanket-deny it.
+ Config2.onoff.enable_purge = 1;
+ }
CbDataList<HttpRequestMethod> *q = new CbDataList<HttpRequestMethod> (HttpRequestMethod(t, NULL));
*(Tail) = q;
Tail = &q->next;
#endif
- if (aclPurgeMethodInUse(Config.accessList.http))
- Config2.onoff.enable_purge = 1;
+ // we have reconfigured and in the process disabled any need for PURGE.
+ // turn it off now.
+ if(Config2.onoff.enable_purge == 2)
+ Config2.onoff.enable_purge = 0;
Config2.onoff.mangle_request_headers = httpReqHdrManglersConfigured();
errorClean();
enter_suid(); /* root to read config file */
+
+ // we may have disabled the need for PURGE
+ if(Config2.onoff.enable_purge)
+ Config2.onoff.enable_purge = 2;
+
parseConfigFile(ConfigFile);
+
setUmask(Config.umask);
Mem::Report();
setEffectiveUser();