]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
make source_ping feature not compiled by default
authorwessels <>
Sat, 7 Mar 1998 05:53:05 +0000 (05:53 +0000)
committerwessels <>
Sat, 7 Mar 1998 05:53:05 +0000 (05:53 +0000)
src/cf.data.pre
src/neighbors.cc
src/peer_select.cc
src/structs.h

index ecd716f094bf8c36670d7c232158d67814648dd9..d15663f990c2bc05b254936df172abab2859c7b0 100644 (file)
@@ -293,11 +293,11 @@ DOC_START
 single_parent_bypass off
 DOC_END
 
-
 NAME: source_ping
 COMMENT: on|off
 TYPE: onoff
 DEFAULT: off
+IFDEF: ALLOW_SOURCE_PING
 LOC: Config.onoff.source_ping
 DOC_START
        If source_ping is enabled, then Squid will include the source
index 3c005deaeff23a06d4daf23db3ce6da26794fe25..0283fb1a892de4672b081ec0818172040c0d184a 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: neighbors.cc,v 1.178 1998/03/05 08:33:42 wessels Exp $
+ * $Id: neighbors.cc,v 1.179 1998/03/06 22:53:07 wessels Exp $
  *
  * DEBUG: section 15    Neighbor Routines
  * AUTHOR: Harvest Derived
@@ -407,11 +407,8 @@ neighborsUdpPing(request_t * request,
     void *callback_data,
     int *exprep)
 {
-    char *host = request->host;
     const char *url = storeUrl(entry);
     MemObject *mem = entry->mem_obj;
-    const ipcache_addrs *ia = NULL;
-    struct sockaddr_in to_addr;
     peer *p = NULL;
     int i;
     int reqnum = 0;
@@ -492,8 +489,12 @@ neighborsUdpPing(request_t * request,
     if ((first_ping = first_ping->next) == NULL)
        first_ping = Config.peers;
 
+#if ALLOW_SOURCE_PING
     /* only do source_ping if we have neighbors */
     if (Config.npeers) {
+        const ipcache_addrs *ia = NULL;
+        struct sockaddr_in to_addr;
+        char *host = request->host;
        if (!Config.onoff.source_ping) {
            debug(15, 6) ("neighborsUdpPing: Source Ping is disabled.\n");
        } else if ((ia = ipcache_gethostbyname(host, 0))) {
@@ -518,6 +519,7 @@ neighborsUdpPing(request_t * request,
                host);
        }
     }
+#endif
 #if LOG_ICP_NUMBERS
     request->hierarchy.n_sent = peers_pinged;
     request->hierarchy.n_expect = *exprep;
@@ -692,10 +694,12 @@ neighborsUdpAck(const char *url, icp_common_t * header, const struct sockaddr_in
        if (p) {
            debug(15, 1) ("Ignoring SECHO from neighbor %s\n", p->host);
            neighborCountIgnored(p, opcode);
-       } else if (!Config.onoff.source_ping) {
-           debug(15, 1) ("Unsolicited SECHO from %s\n", inet_ntoa(from->sin_addr));
-       } else {
+#if ALLOW_SOURCE_PING
+       } else if (Config.onoff.source_ping) {
            mem->icp_reply_callback(NULL, ntype, header, mem->ircb_data);
+#endif
+       } else {
+           debug(15, 1) ("Unsolicited SECHO from %s\n", inet_ntoa(from->sin_addr));
        }
     } else if (opcode == ICP_DENIED) {
        if (p == NULL) {
index ce23cf03ccfe32d085bb76cb4367d50fa7906157..a97f0ba8bb581c5651545fa9f1012195db4f84d7 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: peer_select.cc,v 1.39 1998/03/05 08:28:01 wessels Exp $
+ * $Id: peer_select.cc,v 1.40 1998/03/06 22:53:06 wessels Exp $
  *
  * DEBUG: section 44    Peer Selection Algorithm
  * AUTHOR: Duane Wessels
@@ -95,9 +95,12 @@ peerSelectIcpPing(request_t * request, int direct, StoreEntry * entry)
     assert(direct != DIRECT_YES);
     if (!EBIT_TEST(entry->flag, HIERARCHICAL) && direct != DIRECT_NO)
        return 0;
-    if (Config.onoff.single_parent_bypass && !Config.onoff.source_ping)
-       if (getSingleParent(request))
-           return 0;
+    if (Config.onoff.single_parent_bypass)
+#if ALLOW_SOURCE_PING
+       if (!Config.onoff.source_ping)
+#endif
+           if (getSingleParent(request))
+               return 0;
     if (EBIT_TEST(entry->flag, KEY_PRIVATE) && !neighbors_do_private_keys)
        if (direct != DIRECT_NO)
            return 0;
index 0061241c1d3df77c68bceeb59a275519bf3c3ac8..1b7c8f4ffe1242ff379676faf6e8b5cecd049396 100644 (file)
@@ -293,7 +293,9 @@ struct _SquidConfig {
        int query_icmp;
        int icp_hit_stale;
        int buffered_logs;
+#if ALLOW_SOURCE_PING
        int source_ping;
+#endif
        int common_log;
        int log_mime_hdrs;
        int ident_lookup;