From: wessels <> Date: Thu, 5 Dec 1996 00:51:40 +0000 (+0000) Subject: - Fixed loop detection for two squids on the same host (Mark Treacy) X-Git-Tag: SQUID_3_0_PRE1~5342 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a08307ebd9415b52e11f1d8da4c815acf7208732;p=thirdparty%2Fsquid.git - Fixed loop detection for two squids on the same host (Mark Treacy) --- diff --git a/src/cache_cf.cc b/src/cache_cf.cc index 0e1c26f337..6afc7662bb 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -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); } diff --git a/src/http.cc b/src/http.cc index 0d95744055..8a7fe4b974 100644 --- a/src/http.cc +++ b/src/http.cc @@ -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); diff --git a/src/main.cc b/src/main.cc index a0f2f75066..dfcb43a418 100644 --- a/src/main.cc +++ b/src/main.cc @@ -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 *));