--------------------- PatchSet 11592 Date: 2007/08/28 23:51:01 Author: hno Branch: HEAD Tag: (none) Log: Bug #1972: Squid sets peers to down state when they are in fact working. This patch fixes a problem where peers which was declared DEAD when Squid refreshes the peer IP addresses (done once per hour) got marked as permanently down requiring a "squid -k recondigure" to bring the peer alive again. Members: src/cache_cf.c:1.470->1.471 src/neighbors.c:1.318->1.319 Index: squid/src/cache_cf.c =================================================================== RCS file: /cvsroot/squid/squid/src/cache_cf.c,v retrieving revision 1.470 retrieving revision 1.471 diff -u -r1.470 -r1.471 --- squid/src/cache_cf.c 20 Jul 2007 21:08:47 -0000 1.470 +++ squid/src/cache_cf.c 28 Aug 2007 23:51:01 -0000 1.471 @@ -1,6 +1,6 @@ /* - * $Id: cache_cf.c,v 1.470 2007/07/20 21:08:47 hno Exp $ + * $Id: cache_cf.c,v 1.471 2007/08/28 23:51:01 hno Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -1621,6 +1621,7 @@ p->stats.logged_state = PEER_ALIVE; p->monitor.state = PEER_ALIVE; p->monitor.interval = 300; + p->tcp_up = PEER_TCP_MAGIC_COUNT; if ((token = strtok(NULL, w_space)) == NULL) self_destruct(); p->host = xstrdup(token); Index: squid/src/neighbors.c =================================================================== RCS file: /cvsroot/squid/squid/src/neighbors.c,v retrieving revision 1.318 retrieving revision 1.319 diff -u -r1.318 -r1.319 --- squid/src/neighbors.c 20 Jul 2007 21:08:47 -0000 1.318 +++ squid/src/neighbors.c 28 Aug 2007 23:51:01 -0000 1.319 @@ -1,6 +1,6 @@ /* - * $Id: neighbors.c,v 1.318 2007/07/20 21:08:47 hno Exp $ + * $Id: neighbors.c,v 1.319 2007/08/28 23:51:01 hno Exp $ * * DEBUG: section 15 Neighbor Routines * AUTHOR: Harvest Derived @@ -1010,12 +1010,13 @@ debug(0, 0) ("WARNING: No IP address found for '%s'!\n", p->host); return; } - p->tcp_up = PEER_TCP_MAGIC_COUNT; for (j = 0; j < (int) ia->count && j < PEER_MAX_ADDRESSES; j++) { p->addresses[j] = ia->in_addrs[j]; debug(15, 2) ("--> IP address #%d: %s\n", j, inet_ntoa(p->addresses[j])); p->n_addresses++; } + if (!p->tcp_up) + peerProbeConnect((peer *) p); ap = &p->in_addr; memset(ap, '\0', sizeof(struct sockaddr_in)); ap->sin_family = AF_INET;