From: wessels <> Date: Fri, 15 Nov 1996 14:51:04 +0000 (+0000) Subject: scattered w_space's everywhere X-Git-Tag: SQUID_3_0_PRE1~5459 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4db43fab0c910f9c0538ecf7c809352de1e9713b;p=thirdparty%2Fsquid.git scattered w_space's everywhere fixed cache-control parsing --- diff --git a/src/acl.cc b/src/acl.cc index 3801e9f640..a2f4f60593 100644 --- a/src/acl.cc +++ b/src/acl.cc @@ -1,5 +1,5 @@ /* - * $Id: acl.cc,v 1.63 1996/11/15 00:36:12 wessels Exp $ + * $Id: acl.cc,v 1.64 1996/11/15 07:51:04 wessels Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -48,6 +48,7 @@ struct _acl_access *DelayAccessList = NULL; static struct _acl *AclList = NULL; static struct _acl **AclListTail = &AclList; +static const char *const w_space = " \t\n\r"; /* Jasper sez so */ static void aclDestroyAclList _PARAMS((struct _acl_list * list)); static void aclDestroyIpList _PARAMS((struct _acl_ip_data * data)); diff --git a/src/cache_cf.cc b/src/cache_cf.cc index 09456af188..95ba0af71e 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -1,5 +1,5 @@ /* - * $Id: cache_cf.cc,v 1.138 1996/11/15 00:36:14 wessels Exp $ + * $Id: cache_cf.cc,v 1.139 1996/11/15 07:51:05 wessels Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -205,8 +205,8 @@ char *ConfigFile = NULL; /* the whole thing */ const char *cfg_filename = NULL; /* just the last part */ char ForwardedBy[256] = ""; -const char *const w_space = " \t\n"; -const char *const list_sep = ", \t\n"; +static const char *const w_space = " \t\n\r"; +static const char *const list_sep = ", \t\n\r"; char config_input_line[BUFSIZ]; int config_lineno = 0; diff --git a/src/cachemgr.cc b/src/cachemgr.cc index ce7e2484d3..e4c1307614 100644 --- a/src/cachemgr.cc +++ b/src/cachemgr.cc @@ -1,6 +1,6 @@ /* - * $Id: cachemgr.cc,v 1.44 1996/11/15 00:36:15 wessels Exp $ + * $Id: cachemgr.cc,v 1.45 1996/11/15 07:51:06 wessels Exp $ * * DEBUG: Section 0 CGI Cache Manager * AUTHOR: Harvest Derived @@ -299,7 +299,7 @@ static const char *const op_cmds_descr[] = static int hasTables = FALSE; static const char *script_name = "/cgi-bin/cachemgr.cgi"; -static const char *const w_space = " \t\n"; +static const char *const w_space = " \t\n\r"; static const char *progname = NULL; static time_t now; diff --git a/src/debug.cc b/src/debug.cc index 4c25ff69dd..ef38efb224 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -1,5 +1,5 @@ /* - * $Id: debug.cc,v 1.37 1996/11/15 00:36:16 wessels Exp $ + * $Id: debug.cc,v 1.38 1996/11/15 07:51:07 wessels Exp $ * * DEBUG: section 0 Debug Routines * AUTHOR: Harvest Derived @@ -110,6 +110,7 @@ volatile int _db_line = 0; FILE *debug_log = NULL; static char *debug_log_file = NULL; +static const char *const w_space = " \t\n\r"; #define MAX_DEBUG_SECTIONS 100 static int debugLevels[MAX_DEBUG_SECTIONS]; diff --git a/src/fqdncache.cc b/src/fqdncache.cc index 7e0af998bf..e8b2718b04 100644 --- a/src/fqdncache.cc +++ b/src/fqdncache.cc @@ -1,6 +1,6 @@ /* - * $Id: fqdncache.cc,v 1.35 1996/11/15 00:36:17 wessels Exp $ + * $Id: fqdncache.cc,v 1.36 1996/11/15 07:51:07 wessels Exp $ * * DEBUG: section 35 FQDN Cache * AUTHOR: Harvest Derived @@ -171,6 +171,7 @@ static char fqdncache_status_char[] = static long fqdncache_low = 180; static long fqdncache_high = 200; +static const char *const w_space = " \t\n\r"; static void fqdncacheEnqueue(fqdncache_entry * f) diff --git a/src/ftp.cc b/src/ftp.cc index 2df4a6aeb5..d697d8dfc3 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -1,6 +1,6 @@ /* - * $Id: ftp.cc,v 1.82 1996/11/14 19:02:16 wessels Exp $ + * $Id: ftp.cc,v 1.83 1996/11/15 07:51:08 wessels Exp $ * * DEBUG: section 9 File Transfer Protocol (FTP) * AUTHOR: Harvest Derived @@ -113,6 +113,7 @@ static int ftpget_server_read = -1; static int ftpget_server_write = -1; static u_short ftpget_port = 0; +static const char *const w_space = " \t\n\r"; typedef struct _Ftpdata { StoreEntry *entry; diff --git a/src/http.cc b/src/http.cc index 9d1f4ef7a3..4028683aff 100644 --- a/src/http.cc +++ b/src/http.cc @@ -1,5 +1,5 @@ /* - * $Id: http.cc,v 1.107 1996/11/15 00:36:19 wessels Exp $ + * $Id: http.cc,v 1.108 1996/11/15 07:51:09 wessels Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -107,6 +107,8 @@ #define HTTP_DELETE_GAP (1<<18) +static const char *const w_space = " \t\n\r"; + typedef enum { SCC_PUBLIC, SCC_PRIVATE, @@ -295,23 +297,24 @@ httpParseReplyHeaders(const char *buf, struct _http_reply *reply) ReplyHeaderStats.lm++; } } else if (!strncasecmp(t, "Cache-Control:", 14)) { - if ((t = strtok(NULL, w_space))) { - if (!strncasecmp(t, "public", 6)) { - EBIT_SET(reply->cache_control, SCC_PUBLIC); - ReplyHeaderStats.cc[SCC_PUBLIC]++; - } else if (!strncasecmp(t, "private", 7)) { - EBIT_SET(reply->cache_control, SCC_PRIVATE); - ReplyHeaderStats.cc[SCC_PRIVATE]++; - } else if (!strncasecmp(t, "no-cache", 8)) { - EBIT_SET(reply->cache_control, SCC_NOCACHE); - ReplyHeaderStats.cc[SCC_NOCACHE]++; - } else if (!strncasecmp(t, "max-age", 7)) { - if ((t = strchr(t, '='))) { - delta = atoi(++t); - EBIT_SET(reply->cache_control, SCC_MAXAGE); - ReplyHeaderStats.cc[SCC_MAXAGE]++; - strcpy(reply->expires, mkrfc1123(squid_curtime + delta)); - } + t += 14; + while (*t == ' ' || *t == '\t') + t++; + if (!strncasecmp(t, "public", 6)) { + EBIT_SET(reply->cache_control, SCC_PUBLIC); + ReplyHeaderStats.cc[SCC_PUBLIC]++; + } else if (!strncasecmp(t, "private", 7)) { + EBIT_SET(reply->cache_control, SCC_PRIVATE); + ReplyHeaderStats.cc[SCC_PRIVATE]++; + } else if (!strncasecmp(t, "no-cache", 8)) { + EBIT_SET(reply->cache_control, SCC_NOCACHE); + ReplyHeaderStats.cc[SCC_NOCACHE]++; + } else if (!strncasecmp(t, "max-age", 7)) { + if ((t = strchr(t, '='))) { + delta = atoi(++t); + EBIT_SET(reply->cache_control, SCC_MAXAGE); + ReplyHeaderStats.cc[SCC_MAXAGE]++; + strcpy(reply->expires, mkrfc1123(squid_curtime + delta)); } } } @@ -877,7 +880,7 @@ httpReplyHeaderStats(StoreEntry * entry) ReplyHeaderStats.ctype); storeAppendPrintf(entry, "{ Content-Length: %d}\n", ReplyHeaderStats.clen); - for (i = 0; i < SCC_ENUM_END; i++) + for (i = SCC_PUBLIC; i < SCC_ENUM_END; i++) storeAppendPrintf(entry, "{Cache-Control %7.7s: %d}\n", HttpServerCCStr[i], ReplyHeaderStats.cc[i]); diff --git a/src/ipcache.cc b/src/ipcache.cc index aac1956b5d..5a5788c7b1 100644 --- a/src/ipcache.cc +++ b/src/ipcache.cc @@ -1,5 +1,5 @@ /* - * $Id: ipcache.cc,v 1.85 1996/11/12 22:37:09 wessels Exp $ + * $Id: ipcache.cc,v 1.86 1996/11/15 07:51:10 wessels Exp $ * * DEBUG: section 14 IP Cache * AUTHOR: Harvest Derived @@ -176,6 +176,7 @@ static char ipcache_status_char[] = static long ipcache_low = 180; static long ipcache_high = 200; +static const char *const w_space = " \t\n\r"; #if LIBRESOLV_DNS_TTL_HACK extern int _dns_ttl_; diff --git a/src/pinger.cc b/src/pinger.cc index d15a8fea34..ab2acffa52 100644 --- a/src/pinger.cc +++ b/src/pinger.cc @@ -1,7 +1,7 @@ /* - * $Id: pinger.cc,v 1.16 1996/11/14 18:38:46 wessels Exp $ + * $Id: pinger.cc,v 1.17 1996/11/15 07:51:11 wessels Exp $ * * DEBUG: section 37 ICMP Routines * AUTHOR: Duane Wessels @@ -36,7 +36,6 @@ /* Junk so we can link with debug.o */ int opt_syslog_enable = 0; volatile int unbuffered_logs = 1; -const char *const w_space = " \t\n\r"; const char *const appname = "pinger"; struct timeval current_time; time_t squid_curtime;