--------------------- PatchSet 11606 Date: 2007/08/31 13:49:54 Author: hno Branch: SQUID_2_6 Tag: (none) Log: MFC: 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. Merged changes: 2007/08/28 23:51:01 hno +5 -3 Bug #1972: Squid sets peers to down state when they are in fact working. Members: src/cache_cf.c:1.463.2.3->1.463.2.4 src/neighbors.c:1.313.2.1->1.313.2.2 Index: squid/src/cache_cf.c =================================================================== RCS file: /cvsroot/squid/squid/src/cache_cf.c,v retrieving revision 1.463.2.3 retrieving revision 1.463.2.4 diff -u -r1.463.2.3 -r1.463.2.4 --- squid/src/cache_cf.c 23 Jun 2007 22:50:18 -0000 1.463.2.3 +++ squid/src/cache_cf.c 31 Aug 2007 13:49:54 -0000 1.463.2.4 @@ -1,6 +1,6 @@ /* - * $Id: cache_cf.c,v 1.463.2.3 2007/06/23 22:50:18 hno Exp $ + * $Id: cache_cf.c,v 1.463.2.4 2007/08/31 13:49:54 hno Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -1626,6 +1626,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.313.2.1 retrieving revision 1.313.2.2 diff -u -r1.313.2.1 -r1.313.2.2 --- squid/src/neighbors.c 26 Feb 2007 22:45:24 -0000 1.313.2.1 +++ squid/src/neighbors.c 31 Aug 2007 13:49:54 -0000 1.313.2.2 @@ -1,6 +1,6 @@ /* - * $Id: neighbors.c,v 1.313.2.1 2007/02/26 22:45:24 hno Exp $ + * $Id: neighbors.c,v 1.313.2.2 2007/08/31 13:49:54 hno Exp $ * * DEBUG: section 15 Neighbor Routines * AUTHOR: Harvest Derived @@ -1014,12 +1014,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;