]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug #1840: Disable digest and netdb queries to multicast peers
authorserassio <>
Sun, 24 Dec 2006 20:43:08 +0000 (20:43 +0000)
committerserassio <>
Sun, 24 Dec 2006 20:43:08 +0000 (20:43 +0000)
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.

src/cache_cf.cc
src/neighbors.cc

index 42276b690e7b33f93620ca72cf82c88e89d9e890..227c22d90a45ef88952a75670b67757bfca33166 100644 (file)
@@ -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<sockaddr_in_list *>(xcalloc(1, sizeof(*s)));
index a9fbf8356b3040b7340b0b8b7f5a64332deb0d02..f3234d4da88bd6c37f3c9866a7f9687488d17662 100644 (file)
@@ -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;
     }