/*
- * $Id: cache_cf.cc,v 1.64 1996/07/25 07:10:27 wessels Exp $
+ * $Id: cache_cf.cc,v 1.65 1996/07/26 17:18:21 wessels Exp $
*
* DEBUG: section 3 Configuration File Parsing
* AUTHOR: Harvest Derived
}
}
-static void parseHttpStopLine()
-{
- char *token;
- token = strtok(NULL, w_space);
- if (token == NULL)
- return;
- wordlistAdd(&Config.http_stoplist, token);
-}
-
-static void parseGopherStopLine()
-{
- char *token;
- token = strtok(NULL, w_space);
- if (token == NULL)
- return;
- wordlistAdd(&Config.gopher_stoplist, token);
-}
-static void parseFtpStopLine()
-{
- char *token;
- token = strtok(NULL, w_space);
- if (token == NULL)
- return;
- wordlistAdd(&Config.ftp_stoplist, token);
-}
static void parseHierarchyStoplistLine()
{
char *token;
else if (!strcmp(token, "icp_access"))
aclParseAccessLine(&ICPAccessList);
- /* Parse a http_stop line */
- else if (!strcmp(token, "http_stop"))
- parseHttpStopLine();
-
- /* Parse a gopher_stop line */
- else if (!strcmp(token, "gopher_stop"))
- parseGopherStopLine();
-
- /* Parse a ftp_stop line */
- else if (!strcmp(token, "ftp_stop"))
- parseFtpStopLine();
-
/* Parse a hierarchy_stoplist line */
else if (!strcmp(token, "hierarchy_stoplist"))
parseHierarchyStoplistLine();
safe_free(Config.Announce.host);
safe_free(Config.Announce.file);
wordlistDestroy(&Config.cache_dirs);
- wordlistDestroy(&Config.http_stoplist);
- wordlistDestroy(&Config.gopher_stoplist);
- wordlistDestroy(&Config.ftp_stoplist);
wordlistDestroy(&Config.hierarchy_stoplist);
wordlistDestroy(&Config.local_domain_list);
wordlistDestroy(&Config.inside_firewall_list);
/*
- * $Id: ftp.cc,v 1.48 1996/07/25 07:10:34 wessels Exp $
+ * $Id: ftp.cc,v 1.49 1996/07/26 17:18:21 wessels Exp $
*
* DEBUG: section 9 File Transfer Protocol (FTP)
* AUTHOR: Harvest Derived
}
}
-int ftpCachable(url)
- char *url;
-{
- wordlist *p = NULL;
-
- /* scan stop list */
- for (p = Config.ftp_stoplist; p; p = p->next) {
- if (strstr(url, p->key))
- return 0;
- }
-
- /* else cachable */
- return 1;
-}
-
/* This will be called when socket lifetime is expired. */
void ftpLifetimeExpire(fd, data)
int fd;
/*
- * $Id: gopher.cc,v 1.37 1996/07/25 07:10:34 wessels Exp $
+ * $Id: gopher.cc,v 1.38 1996/07/26 17:18:23 wessels Exp $
*
* DEBUG: section 10 Gopher
* AUTHOR: Harvest Derived
int gopherCachable(url)
char *url;
{
- wordlist *p = NULL;
GopherData *data = NULL;
int cachable = 1;
- /* scan stop list */
- for (p = Config.gopher_stoplist; p; p = p->next)
- if (strstr(url, p->key))
- return 0;
-
/* use as temp data structure to parse gopher URL */
data = CreateGopherData();
/*
- * $Id: http.cc,v 1.66 1996/07/25 07:10:35 wessels Exp $
+ * $Id: http.cc,v 1.67 1996/07/26 17:18:23 wessels Exp $
*
* DEBUG: section 11 Hypertext Transfer Protocol (HTTP)
* AUTHOR: Harvest Derived
char *url;
int method;
{
- wordlist *p = NULL;
-
/* GET and HEAD are cachable. Others are not. */
if (method != METHOD_GET && method != METHOD_HEAD)
return 0;
-
- /* scan stop list */
- for (p = Config.http_stoplist; p; p = p->next) {
- if (strstr(url, p->key))
- return 0;
- }
-
/* else cachable */
return 1;
}
/*
- * $Id: stat.cc,v 1.49 1996/07/26 17:00:35 wessels Exp $
+ * $Id: stat.cc,v 1.50 1996/07/26 17:18:26 wessels Exp $
*
* DEBUG: section 18 Cache Manager Statistics
* AUTHOR: Harvest Derived
StoreEntry *sentry;
{
char *tod = NULL;
- wordlist *p = NULL;
float f;
#ifdef HAVE_MALLINFO
int t;
storeAppendPrintf(sentry, "{\tReserved number of file descriptors: %4d}\n",
RESERVED_FD);
- storeAppendPrintf(sentry, "{Stop List:}\n");
- if ((p = Config.http_stoplist)) {
- storeAppendPrintf(sentry, "{\tHTTP:}\n");
- while (p) {
- storeAppendPrintf(sentry, "{\t\t%s}\n", p->key);
- p = p->next;
- }
- }
- if ((p = Config.gopher_stoplist)) {
- storeAppendPrintf(sentry, "{\tGOPHER:}\n");
- while (p) {
- storeAppendPrintf(sentry, "{\t\t%s}\n", p->key);
- p = p->next;
- }
- }
- if ((p = Config.ftp_stoplist)) {
- storeAppendPrintf(sentry, "{\tFTP:}\n");
- while (p) {
- storeAppendPrintf(sentry, "{\t\t%s}\n", p->key);
- p = p->next;
- }
- }
storeAppendPrintf(sentry, "{Internal Data Structures:}\n");
storeAppendPrintf(sentry, "{\tHot Object Cache Items %d}\n",
meta_data.hot_vm);