/*
- * $Id: acl.cc,v 1.210 2000/01/05 23:32:17 wessels Exp $
+ * $Id: acl.cc,v 1.211 2000/01/14 08:37:03 wessels Exp $
*
* DEBUG: section 28 Access Control
* AUTHOR: Duane Wessels
while ((t = strtokFile())) {
q = memAllocate(MEM_INTLIST);
q->i = (int) urlParseMethod(t);
- if (q->i == METHOD_PURGE)
- Config.onoff.enable_purge = 1;
*(Tail) = q;
Tail = &q->next;
}
return 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.
+ */
+int
+aclPurgeMethodInUse(acl_access * a)
+{
+ acl_list *b;
+ for (; a; a = a->next) {
+ for (b = a->acl_list; b; b = b->next) {
+ if (ACL_METHOD != b->acl->type)
+ continue;
+ if (aclMatchInteger(b->acl->data, METHOD_PURGE))
+ return 1;
+ }
+ }
+ return 0;
+}
#if USE_ARP_ACL
/*
- * $Id: cache_cf.cc,v 1.335 1999/12/30 17:36:23 wessels Exp $
+ * $Id: cache_cf.cc,v 1.336 2000/01/14 08:37:04 wessels Exp $
*
* DEBUG: section 3 Configuration File Parsing
* AUTHOR: Harvest Derived
Config.Wais.peer->host = xstrdup(Config.Wais.relayHost);
Config.Wais.peer->http_port = Config.Wais.relayPort;
}
+ if (aclPurgeMethodInUse(Config.accessList.http))
+ Config2.onoff.enable_purge = 1;
}
/* Parse a time specification from the config file. Store the
/*
- * $Id: client_side.cc,v 1.468 2000/01/05 23:32:19 wessels Exp $
+ * $Id: client_side.cc,v 1.469 2000/01/14 08:37:05 wessels Exp $
*
* DEBUG: section 33 Client-side Routines
* AUTHOR: Duane Wessels
StoreEntry *entry;
ErrorState *err = NULL;
HttpReply *r;
- debug(33, 3) ("Config.onoff.enable_purge = %d\n", Config.onoff.enable_purge);
- if (!Config.onoff.enable_purge) {
+ debug(33, 1) ("Config2.onoff.enable_purge = %d\n", Config2.onoff.enable_purge);
+ if (!Config2.onoff.enable_purge) {
http->log_type = LOG_TCP_DENIED;
err = errorCon(ERR_ACCESS_DENIED, HTTP_FORBIDDEN);
err->request = requestLink(http->request);
/*
- * $Id: protos.h,v 1.353 2000/01/11 05:00:29 wessels Exp $
+ * $Id: protos.h,v 1.354 2000/01/14 08:37:07 wessels Exp $
*
*
* SQUID Internet Object Cache http://squid.nlanr.net/Squid/
extern void aclParseRegexList(void *curlist);
extern const char *aclTypeToStr(squid_acl);
extern wordlist *aclDumpGeneric(const acl *);
+extern int aclPurgeMethodInUse(acl_access *);
#if USE_ASYNC_IO
extern int aio_cancel(aio_result_t *);
extern int storeTooManyDiskFilesOpen(void);
extern void storeEntryReset(StoreEntry *);
extern void storeHeapPositionUpdate(StoreEntry *);
-extern void storeSwapFileNumberSet(StoreEntry *e, sfileno filn);
+extern void storeSwapFileNumberSet(StoreEntry * e, sfileno filn);
/* store_io.c */
extern STOBJOPEN storeOpen;
/*
- * $Id: structs.h,v 1.311 2000/01/11 05:32:58 wessels Exp $
+ * $Id: structs.h,v 1.312 2000/01/14 08:37:08 wessels Exp $
*
*
* SQUID Internet Object Cache http://squid.nlanr.net/Squid/
} Netdb;
struct {
int log_udp;
- int enable_purge;
int res_defnames;
int anonymizer;
int client_db;
char *prefix;
int on;
} Accel;
+ struct {
+ int enable_purge;
+ } onoff;
};
struct _close_handler {