]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
We had false loop detections because "ee.lbl.gov" matched "ren.ee.lbl.gov".
authorwessels <>
Wed, 20 Jan 1999 03:26:32 +0000 (03:26 +0000)
committerwessels <>
Wed, 20 Jan 1999 03:26:32 +0000 (03:26 +0000)
Added variable (ThisCache2) that has a space prepended to the hostname
so we now search for " ee.lbl.gov".

src/cache_cf.cc
src/client_side.cc
src/globals.h

index 82d4a8c03d075342aaf54ec7ad52d2a502ee53f0..030c50dfa950f92f80dad7cd305cefae55b85cd6 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cache_cf.cc,v 1.317 1998/12/16 00:07:17 wessels Exp $
+ * $Id: cache_cf.cc,v 1.318 1999/01/19 20:26:33 wessels Exp $
  *
  * DEBUG: section 3     Configuration File Parsing
  * AUTHOR: Harvest Derived
@@ -262,6 +262,14 @@ configDoConfigure(void)
        uniqueHostname(),
        (int) Config.Port.http->i,
        full_appname_string);
+    /*
+     * the extra space is for loop detection in client_side.c -- we search
+     * for substrings in the Via header.
+     */
+    snprintf(ThisCache2, sizeof(ThisCache), " %s:%d (%s)",
+       uniqueHostname(),
+       (int) Config.Port.http->i,
+       full_appname_string);
     if (!Config.udpMaxHitObjsz || Config.udpMaxHitObjsz > SQUID_UDP_SO_SNDBUF)
        Config.udpMaxHitObjsz = SQUID_UDP_SO_SNDBUF;
     if (Config.appendDomain)
index cbf12cccc58b491fd65b071a6ee2f974066e2d66..4e657dc474f0baad1033722177c52f1a0df25549 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.432 1999/01/19 02:24:23 wessels Exp $
+ * $Id: client_side.cc,v 1.433 1999/01/19 20:26:35 wessels Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -739,8 +739,12 @@ clientInterpretRequestHeaders(clientHttpRequest * http)
        request->flags.auth = 1;
     if (httpHeaderHas(req_hdr, HDR_VIA)) {
        String s = httpHeaderGetList(req_hdr, HDR_VIA);
-       /* ThisCache cannot be a member of Via header, "1.0 ThisCache" can */
-       if (strListIsSubstr(&s, ThisCache, ',')) {
+       /*
+        * ThisCache cannot be a member of Via header, "1.0 ThisCache" can.
+        * Note ThisCache2 has a space prepended to the hostname so we don't
+        * accidentally match super-domains.
+        */
+       if (strListIsSubstr(&s, ThisCache2, ',')) {
            debugObj(33, 1, "WARNING: Forwarding loop detected for:\n",
                request, (ObjPackMethod) & httpRequestPack);
            request->flags.loopdetect = 1;
index 80be0c8ff09437c594ffb490b9a3e03bf76bc563..24faabdc687d4dc65dddef247fb1ac212932e58b 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: globals.h,v 1.74 1998/12/09 23:01:00 wessels Exp $
+ * $Id: globals.h,v 1.75 1999/01/19 20:26:32 wessels Exp $
  *
  *
  * SQUID Internet Object Cache  http://squid.nlanr.net/Squid/
@@ -42,6 +42,7 @@ extern const char *log_tags[];
 extern char tmp_error_buf[ERROR_BUF_SZ];
 extern char *volatile debug_options;   /* NULL */
 extern char ThisCache[SQUIDHOSTNAMELEN << 1];
+extern char ThisCache2[SQUIDHOSTNAMELEN << 1];
 extern char config_input_line[BUFSIZ];
 extern const char *AclMatchedName;     /* NULL */
 extern const char *DefaultConfigFile;  /* DEFAULT_CONFIG_FILE */