]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
scattered w_space's everywhere
authorwessels <>
Fri, 15 Nov 1996 14:51:04 +0000 (14:51 +0000)
committerwessels <>
Fri, 15 Nov 1996 14:51:04 +0000 (14:51 +0000)
fixed cache-control parsing

src/acl.cc
src/cache_cf.cc
src/cachemgr.cc
src/debug.cc
src/fqdncache.cc
src/ftp.cc
src/http.cc
src/ipcache.cc
src/pinger.cc

index 3801e9f64084d6108ad9fb4bab198a889e32f499..a2f4f605939edf45b0589a4096acf0e5c98ba951 100644 (file)
@@ -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));
index 09456af1881a716ddcceb956c6ea3d3816690b98..95ba0af71ea94d2feb2fa92f44f63aa37dfff368 100644 (file)
@@ -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;
 
index ce7e2484d32f7651fbc5ec964efa1515165eb156..e4c1307614ce9e878a0ee308c6f29264daede21e 100644 (file)
@@ -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;
 
index 4c25ff69dd8d49ea48484000ea1bddbab63ef91f..ef38efb224880637a00b3e3300ca580c64f4ac51 100644 (file)
@@ -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];
index 7e0af998bff20d87f2b0ea98a6ff8ec049f66494..e8b2718b042f0e1f5d9bbce47ca9145aacd6c254 100644 (file)
@@ -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)
index 2df4a6aeb5068056249ceda780e2343b6d1f22a3..d697d8dfc336c59bfa96b83d1e02ff2bce671268 100644 (file)
@@ -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
 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;
index 9d1f4ef7a37277121eda8b639cf44f3788fe3525..4028683aff93ef0234e4cce75bf634dfce04f7db 100644 (file)
@@ -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
 
 #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]);
index aac1956b5d5d77c5ff63c99845eae4aaa892095b..5a5788c7b19353fb0e7e87fe36e3e7d1304c399b 100644 (file)
@@ -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_;
index d15a8fea34943d88f9506c53d8cf8c9bcc99d55b..ab2acffa52d584f053bbaf2c456897c6f30aeb25 100644 (file)
@@ -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;