]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Remove PEER_MULTICAST_SIBLINGS conditional (#1854)
authorAmos Jeffries <yadij@users.noreply.github.com>
Sat, 29 Jun 2024 13:55:53 +0000 (13:55 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Sat, 29 Jun 2024 13:56:04 +0000 (13:56 +0000)
Resolving an old TODO.

This is not a feature change, because the undocumented
macro was always set to 1 (enable).

src/CachePeer.h
src/cache_cf.cc
src/neighbors.cc

index f888a0cddea0dfe0b3c716ec285c2067d901380b..5d0addacae41fa58c7c64f6399aa079ebedecc6f 100644 (file)
@@ -19,9 +19,6 @@
 
 #include <iosfwd>
 
-//TODO: remove, it is unconditionally defined and always used.
-#define PEER_MULTICAST_SIBLINGS 1
-
 class NeighborTypeDomainList;
 class PconnPool;
 class PeerDigest;
@@ -141,9 +138,7 @@ public:
         bool sourcehash = false;
         bool originserver = false;
         bool no_tproxy = false;
-#if PEER_MULTICAST_SIBLINGS
         bool mcast_siblings = false;
-#endif
         bool auth_no_keytab = false;
     } options;
 
index c9e3d5994b05e4bb0a82371f998f5f7ba80036ac..2f5ad01eb248a3a94627559136e04b28055225b6 100644 (file)
@@ -2197,10 +2197,8 @@ parse_peer(CachePeers **peers)
             p->options.no_tproxy = true;
         } else if (!strcmp(token, "multicast-responder")) {
             p->options.mcast_responder = true;
-#if PEER_MULTICAST_SIBLINGS
         } else if (!strcmp(token, "multicast-siblings")) {
             p->options.mcast_siblings = true;
-#endif
         } else if (!strncmp(token, "weight=", 7)) {
             p->weight = xatoi(token + 7);
         } else if (!strncmp(token, "basetime=", 9)) {
index 988dd48d88693717a5276148e1c14557d852d7a8..f9898f33ca42e3a43845d84e329e400451bc1c6c 100644 (file)
@@ -121,11 +121,9 @@ neighborType(const CachePeer * p, const AnyP::Uri &url)
             if (d->type != PEER_NONE)
                 return d->type;
     }
-#if PEER_MULTICAST_SIBLINGS
-    if (p->type == PEER_MULTICAST)
-        if (p->options.mcast_siblings)
-            return PEER_SIBLING;
-#endif
+
+    if (p->type == PEER_MULTICAST && p->options.mcast_siblings)
+        return PEER_SIBLING;
 
     return p->type;
 }
@@ -141,11 +139,10 @@ peerAllowedToUse(const CachePeer * p, PeerSelector * ps)
     assert(request != nullptr);
 
     if (neighborType(p, request->url) == PEER_SIBLING) {
-#if PEER_MULTICAST_SIBLINGS
         if (p->type == PEER_MULTICAST && p->options.mcast_siblings &&
                 (request->flags.noCache || request->flags.refresh || request->flags.loopDetected || request->flags.needValidation))
             debugs(15, 2, "multicast-siblings optimization match for " << *p << ", " << request->url.authority());
-#endif
+
         if (request->flags.noCache)
             return false;
 
@@ -1403,10 +1400,8 @@ dump_peer_options(StoreEntry * sentry, CachePeer * p)
     if (p->options.mcast_responder)
         os << " multicast-responder";
 
-#if PEER_MULTICAST_SIBLINGS
     if (p->options.mcast_siblings)
         os << " multicast-siblings";
-#endif
 
     if (p->weight != 1)
         os << " weight=" << p->weight;