Re: Problem with forwarding loops..

From: James R Grinter <jrg@dont-contact.us>
Date: Fri, 27 Jun 1997 14:06:37 +0100

On Fri 27 Jun, 1997, "A. Rytsola" <raccoon@newt.dlc.fi> wrote:
> Seems like I'm getting line like that in cache.log for about
> every missed request. Are these dangerous and how can I get
> rid of them ?

try this patch... it ought to apply ok.

(it adds a parameter to the getMyHostname() function, so as to
indicate whether to return the real hostname or the visible hostname).

-- jrg.

===================================================================
RCS file: /a/cvsroot/src/squid-1.1/src/cache_cf.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- cache_cf.c 1997/04/08 11:51:30 1.7
+++ cache_cf.c 1997/05/28 10:38:06 1.8
@@ -1643,7 +1643,7 @@
     if (httpd_accel_mode && !strcmp(Config.Accel.host, "virtual"))
         vhost_mode = 1;
     sprintf(ThisCache, "%s:%d (Squid/%s)",
- getMyHostname(),
+ getMyHostname(0),
         (int) Config.Port.http,
         SQUID_VERSION);
     if (!Config.udpMaxHitObjsz || Config.udpMaxHitObjsz > SQUID_UDP_SO_SNDBUF)
Index: errorpage.c
===================================================================
RCS file: /a/cvsroot/src/squid-1.1/src/errorpage.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- errorpage.c 1996/11/27 14:20:30 1.1
+++ errorpage.c 1997/05/28 10:38:07 1.2
@@ -178,7 +178,7 @@
         Config.errHtmlText,
         appname,
         version_string,
- getMyHostname());
+ getMyHostname(1));
     strcat(tmp_error_buf, tbuf);
     if (entry->mem_obj) {
         entry->mem_obj->abort_code = type;
@@ -198,6 +198,8 @@
     *tmp_error_buf = '\0';
     if (type < ERR_MIN || type > ERR_MAX)
         fatal_dump("squid_error_url: type out of range.");
+ if (!code)
+ code = 500;
     error_index = (int) (type - ERR_MIN);
     debug(4, 1, "%s: %s\n", ErrorData[error_index].tag, url);
     sprintf(tmp_error_buf, "HTTP/1.0 %d Cache Detected Error\r\nContent-type: text/html\r\n\r\n", code);
@@ -215,7 +217,7 @@
         Config.errHtmlText,
         appname,
         version_string,
- getMyHostname());
+ getMyHostname(1));
     strcat(tmp_error_buf, tbuf);
     return tmp_error_buf;
 }
@@ -253,7 +255,7 @@
         Config.errHtmlText,
         appname,
         version_string,
- getMyHostname());
+ getMyHostname(1));
     strcat(tmp_error_buf, tbuf);
     return tmp_error_buf;
 }
@@ -287,7 +289,7 @@
         Config.errHtmlText,
         appname,
         version_string,
- getMyHostname());
+ getMyHostname(1));
     return tmp_error_buf;
 }
 
@@ -332,7 +334,7 @@
         Config.errHtmlText,
         appname,
         version_string,
- getMyHostname());
+ getMyHostname(1));
     return tmp_error_buf;
 }
 
@@ -360,7 +362,7 @@
         Config.errHtmlText,
         appname,
         version_string,
- getMyHostname());
+ getMyHostname(1));
 
     mk_mime_hdr(tbuf,
         "text/html",
@@ -410,11 +412,11 @@
         code,
         url,
         Config.adminEmail,
- getMyHostname(),
+ getMyHostname(1),
         Config.errHtmlText,
         appname,
         version_string,
- getMyHostname());
+ getMyHostname(1));
     return tmp_error_buf;
 }
 
Index: neighbors.c
===================================================================
RCS file: /a/cvsroot/src/squid-1.1/src/neighbors.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- neighbors.c 1997/04/08 11:51:42 1.9
+++ neighbors.c 1997/05/28 10:38:08 1.10
@@ -833,7 +833,7 @@
     int mcast_ttl)
 {
     peer *e = NULL;
- const char *me = getMyHostname();
+ const char *me = getMyHostname(0);
     if (!strcmp(host, me) && http_port == Config.Port.http) {
         debug(15, 0, "neighborAdd: skipping cache_host %s %s/%d/%d\n",
             type, host, http_port, icp_port);
Index: send-announce.c
===================================================================
RCS file: /a/cvsroot/src/squid-1.1/src/send-announce.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- send-announce.c 1997/02/28 18:01:11 1.2
+++ send-announce.c 1997/05/28 10:38:09 1.3
@@ -63,7 +63,7 @@
     sprintf(tbuf, "cache_version SQUID/%s\n", version_string);
     strcat(sndbuf, tbuf);
     sprintf(tbuf, "Running on %s %d %d\n",
- getMyHostname(),
+ getMyHostname(0),
         Config.Port.http,
         Config.Port.icp);
     strcat(sndbuf, tbuf);
Index: tools.h
===================================================================
RCS file: /a/cvsroot/src/squid-1.1/src/tools.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- tools.h 1996/11/27 14:20:31 1.1
+++ tools.h 1997/05/28 10:43:02 1.2
@@ -106,7 +106,7 @@
 #ifndef TOOLS_H
 #define TOOLS_H
 
-extern const char *getMyHostname _PARAMS((void));
+extern const char *getMyHostname _PARAMS((int visible));
 extern int safeunlink _PARAMS((const char *path, int quiet));
 extern void death _PARAMS((int sig));
 extern void fatal _PARAMS((const char *message));
Received on Fri Jun 27 1997 - 06:07:08 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:35:35 MST