From: serassio <> Date: Sun, 24 Dec 2006 20:43:08 +0000 (+0000) Subject: Bug #1840: Disable digest and netdb queries to multicast peers X-Git-Tag: SQUID_3_0_PRE6~172 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0d5a2006aaf852648c999ebff03a82edc3d7b82c;p=thirdparty%2Fsquid.git Bug #1840: Disable digest and netdb queries to multicast peers Sending HTTP requests to the multicast group does not make much sense. Force digest and netdb exchanged to be disabled on the multicast group. Such exchanges only makes sense on the individual peers. Forward port of 2.6 patch. Also ran astyle. --- diff --git a/src/cache_cf.cc b/src/cache_cf.cc index 42276b690e..227c22d90a 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -1,6 +1,6 @@ /* - * $Id: cache_cf.cc,v 1.502 2006/12/14 01:36:01 hno Exp $ + * $Id: cache_cf.cc,v 1.503 2006/12/24 13:43:08 serassio Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -1499,6 +1499,11 @@ parse_peer(peer ** head) p->type = parseNeighborType(token); + if (p->type == PEER_MULTICAST) { + p->options.no_digest = 1; + p->options.no_netdb_exchange = 1; + } + p->http_port = GetShort(); if (!p->http_port) @@ -2604,7 +2609,7 @@ parse_sockaddr_in_list_token(sockaddr_in_list ** head, char *token) /* port */ } else { host = token; - port = 0; + port = 0; } s = static_cast(xcalloc(1, sizeof(*s))); diff --git a/src/neighbors.cc b/src/neighbors.cc index a9fbf8356b..f3234d4da8 100644 --- a/src/neighbors.cc +++ b/src/neighbors.cc @@ -1,6 +1,6 @@ /* - * $Id: neighbors.cc,v 1.342 2006/12/24 13:30:16 serassio Exp $ + * $Id: neighbors.cc,v 1.343 2006/12/24 13:43:08 serassio Exp $ * * DEBUG: section 15 Neighbor Routines * AUTHOR: Harvest Derived @@ -346,12 +346,12 @@ getRoundRobinParent(HttpRequest * request) if (!peerHTTPOkay(p, request)) continue; - if (p->weight == 1) { - if (q && q->rr_count < p->rr_count) - continue; - } else if (p->weight == 0 || q && q->rr_count < (p->rr_count / p->weight)) { - continue; - } + if (p->weight == 1) { + if (q && q->rr_count < p->rr_count) + continue; + } else if (p->weight == 0 || q && q->rr_count < (p->rr_count / p->weight)) { + continue; + } q = p; }