]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
- Fixed loop detection for two squids on the same host (Mark Treacy)
authorwessels <>
Thu, 5 Dec 1996 00:51:40 +0000 (00:51 +0000)
committerwessels <>
Thu, 5 Dec 1996 00:51:40 +0000 (00:51 +0000)
src/cache_cf.cc
src/http.cc
src/main.cc

index 0e1c26f33740bd271701e7b690b36a8dcce8a976..6afc7662bb123235699108d00b915c27a06a5cc3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: cache_cf.cc,v 1.151 1996/12/03 20:26:48 wessels Exp $
+ * $Id: cache_cf.cc,v 1.152 1996/12/04 17:51:40 wessels Exp $
  *
  * DEBUG: section 3     Configuration File Parsing
  * AUTHOR: Harvest Derived
@@ -1585,4 +1585,8 @@ configDoConfigure(void)
     }
     if (httpd_accel_mode && !strcmp(Config.Accel.host, "virtual"))
        vhost_mode = 1;
+    sprintf(ThisCache, "%s:%d (Squid/%s)",
+       getMyHostname(),
+       (int) Config.Port.http,
+        SQUID_VERSION);
 }
index 0d957440552776f5fd82b360cfabb4cf7ca6f158..8a7fe4b974ae7d2d2d81dedcf7f89d55aa65a1ab 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: http.cc,v 1.126 1996/12/03 23:30:48 wessels Exp $
+ * $Id: http.cc,v 1.127 1996/12/04 17:51:41 wessels Exp $
  *
  * DEBUG: section 11    Hypertext Transfer Protocol (HTTP)
  * AUTHOR: Harvest Derived
@@ -701,16 +701,11 @@ httpBuildRequestHeader(request_t * request,
     }
     hdr_len = t - hdr_in;
     /* Append Via: */
-    sprintf(ybuf, "%3.1f %s:%d (Squid/%s)",
-       orig_request->http_ver,
-       getMyHostname(),
-       (int) Config.Port.http,
-       SQUID_VERSION);
+    sprintf(ybuf, "%3.1f %s" orig_request->http_ver, ThisCache);
     strcat(viabuf, ybuf);
     httpAppendRequestHeader(hdr_out, viabuf, &len, out_sz);
     /* Append to X-Forwarded-For: */
-    if (cfd >= 0)
-       strcat(fwdbuf, fd_table[cfd].ipaddr);
+    strcat(fwdbuf, cfd < 0 ? "unknown" : fd_table[cfd].ipaddr);
     httpAppendRequestHeader(hdr_out, fwdbuf, &len, out_sz);
     if (!EBIT_TEST(hdr_flags, HDR_HOST)) {
        sprintf(ybuf, "Host: %s", orig_request->host);
index a0f2f750667fcad29915391ce377e869807711b8..dfcb43a4185a37cf455c90e58f6e575ec3b30164 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: main.cc,v 1.123 1996/12/03 20:26:57 wessels Exp $
+ * $Id: main.cc,v 1.124 1996/12/04 17:51:43 wessels Exp $
  *
  * DEBUG: section 1     Startup and Main Loop
  * AUTHOR: Harvest Derived
@@ -137,6 +137,7 @@ struct in_addr any_addr;
 struct in_addr theOutICPAddr;
 const char *const dash_str = "-";
 const char *const null_string = "";
+char ThisCache[SQUIDHOSTNAMELEN<<1];
 
 /* for error reporting from xmalloc and friends */
 extern void (*failure_notify) _PARAMS((const char *));