to be us is ignored rather than committing suicide.
Submitted by: Brian Degenhardt <bmd@mp3.com>
John Dilley <jad@hpl.hp.com>
Adrian Chadd <adrian@creative.net.au>
Robert Collins <robert.collins@itdomain.com.au>
+ Brian Degenhardt <bmd@mp3.com>
Development of this caching software is funded by the National Science
Foundation (grants NCR-9616602 and NCR-9521745). Paid staff members on
+Changes to squid-2.5
+ - Fixed forwarding/peer loop detection code (Brian Degenhardt) -
+ now a peer is ignored if it turns out to be us, rather than
+ committing suicide
+
Changes to Squid-2.4.DEVEL4 ():
- Added --enable-auth-modules=... configure option
/*
- * $Id: cache_cf.cc,v 1.354 2000/09/17 23:41:55 hno Exp $
+ * $Id: cache_cf.cc,v 1.355 2000/11/15 12:53:50 adrian Exp $
*
* DEBUG: section 3 Configuration File Parsing
* AUTHOR: Harvest Derived
peer *p;
int i;
sockaddr_in_list *s;
- const char *me = null_string; /* XXX */
+ const char *me = getMyHostname();
p = memAllocate(MEM_PEER);
p->http_port = CACHE_HTTP_PORT;
p->icp.port = CACHE_ICP_PORT;
for (s = Config.Sockaddr.http; s; s = s->next) {
if (p->http_port != ntohs(s->s.sin_port))
continue;
- debug(15, 0) ("parse_peer: Peer looks like myself: %s %s/%d/%d\n",
- p->type, p->host, p->http_port, p->icp.port);
- self_destruct();
+ debug(15, 1) ("parse_peer: Peer looks like myself: Ignoring %s %s/%d/%d\n",
+ neighborTypeStr(p), p->host, p->http_port, p->icp.port);
+ xfree( p->host );
+ memFree( p, MEM_PEER );
+ return;
}
}
while ((token = strtok(NULL, w_space))) {
/*
- * $Id: tools.cc,v 1.197 2000/10/17 08:06:05 adrian Exp $
+ * $Id: tools.cc,v 1.198 2000/11/15 12:53:50 adrian Exp $
*
* DEBUG: section 21 Misc Functions
* AUTHOR: Harvest Derived
inet_ntoa(Config.Sockaddr.http->s.sin_addr),
host);
present = 1;
- return host;
+ if( strchr( host, '.' ) )
+ return host;
+
}
- debug(50, 1) ("WARNING: failed to resolve %s to a hostname\n",
+ debug(50, 1) ("WARNING: failed to resolve %s to a fully qualified hostname\n",
inet_ntoa(Config.Sockaddr.http->s.sin_addr));
}
/*
/* use the official name from DNS lookup */
xstrncpy(host, h->h_name, SQUIDHOSTNAMELEN);
present = 1;
- return host;
+ if( strchr( host, '.' ) )
+ return host;
}
fatal("Could not determine fully qualified hostname. Please set 'visible_hostname'\n");
return NULL; /* keep compiler happy */