From b2ea838f690d122679eeafda2ec30faadf1d5e82 Mon Sep 17 00:00:00 2001 From: Henrik Nordstrom Date: Fri, 11 Jul 2008 21:32:10 +0200 Subject: [PATCH] Remove the --disable-carp option, keeping the CARP code always compiled in this configure option was a relic from the time when CARP was very intrusive, requiring --enable-carp to be compiled and then chainging parent relations. The current CARP implementaiton is very non-intrusive and by default enabled (but not active unless used in squid.conf). There isn't really any good reason to why one should use --disable-carp today. --- configure.in | 12 ------------ squid3.dox | 1 - src/cache_cf.cc | 2 -- src/carp.cc | 4 ---- src/enums.h | 2 -- src/main.cc | 2 -- src/peer_select.cc | 6 ------ src/protos.h | 2 -- src/structs.h | 4 ---- 9 files changed, 35 deletions(-) diff --git a/configure.in b/configure.in index 929e0b1554f..b8b8f64f598 100755 --- a/configure.in +++ b/configure.in @@ -356,18 +356,6 @@ AC_ARG_ENABLE(xmalloc-statistics, fi ]) -use_carp=1 -AC_ARG_ENABLE(carp, -[ --disable-carp Disable CARP support], -[ if test "$enableval" = "no" ; then - echo "CARP disabled" - use_carp=0 - fi -]) -if test $use_carp = 1; then - AC_DEFINE(USE_CARP, 1, [Cache Array Routing Protocol]) -fi - AC_ARG_ENABLE(async-io, [ --enable-async-io[=N_THREADS] Shorthand for diff --git a/squid3.dox b/squid3.dox index d2b89f7c43d..4d6b424916d 100644 --- a/squid3.dox +++ b/squid3.dox @@ -1018,7 +1018,6 @@ PREDEFINED = \ USE_ARP_ACL \ USE_ASYNC_IO \ USE_CACHE_DIGESTS \ - USE_CARP \ USE_CLASSFUL \ USE_DLMALLOC \ USE_DNSSERVERS \ diff --git a/src/cache_cf.cc b/src/cache_cf.cc index f845cf2f2c1..2f03e7425fc 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -1733,7 +1733,6 @@ parse_peer(peer ** head) } else if (!strcasecmp(token, "no-netdb-exchange")) { p->options.no_netdb_exchange = 1; -#if USE_CARP } else if (!strcasecmp(token, "carp")) { if (p->type != PEER_PARENT) @@ -1741,7 +1740,6 @@ parse_peer(peer ** head) p->options.carp = 1; -#endif #if DELAY_POOLS } else if (!strcasecmp(token, "no-delay")) { diff --git a/src/carp.cc b/src/carp.cc index 9c7fa65324a..ad66828fb00 100644 --- a/src/carp.cc +++ b/src/carp.cc @@ -38,8 +38,6 @@ #include "CacheManager.h" #include "Store.h" -#if USE_CARP - #define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) static int n_carp_peers = 0; @@ -227,5 +225,3 @@ carpCachemgr(StoreEntry * sentry) sumfetches ? (double) p->stats.fetches / sumfetches : -1.0); } } - -#endif diff --git a/src/enums.h b/src/enums.h index 24fdd08dabb..8d590dceb69 100644 --- a/src/enums.h +++ b/src/enums.h @@ -173,9 +173,7 @@ typedef enum { CD_PARENT_HIT, CD_SIBLING_HIT, #endif -#if USE_CARP CARP, -#endif ANY_OLD_PARENT, HIER_MAX } hier_code; diff --git a/src/main.cc b/src/main.cc index 0a99057c61c..c27b6a73853 100644 --- a/src/main.cc +++ b/src/main.cc @@ -626,10 +626,8 @@ serverConnectionsOpen(void) asnInit(); ACL::Initialize(); peerSelectInit(); -#if USE_CARP carpInit(); -#endif } void diff --git a/src/peer_select.cc b/src/peer_select.cc index cc9cc221422..f48a7c082a3 100644 --- a/src/peer_select.cc +++ b/src/peer_select.cc @@ -63,9 +63,7 @@ const char *hier_strings[] = "CD_PARENT_HIT", "CD_SIBLING_HIT", #endif -#if USE_CARP "CARP", -#endif "ANY_PARENT", "INVALID CODE" }; @@ -505,12 +503,8 @@ peerGetSomeParent(ps_state * ps) if ((p = getDefaultParent(request))) { code = DEFAULT_PARENT; -#if USE_CARP - } else if ((p = carpSelectParent(request))) { code = CARP; -#endif - } else if ((p = getRoundRobinParent(request))) { code = ROUNDROBIN_PARENT; } else if ((p = getWeightedRoundRobinParent(request))) { diff --git a/src/protos.h b/src/protos.h index f91473f46d0..741556041f5 100644 --- a/src/protos.h +++ b/src/protos.h @@ -728,11 +728,9 @@ SQUIDCEXTERN char *internalRemoteUri(const char *, u_short, const char *, const SQUIDCEXTERN const char *internalHostname(void); SQUIDCEXTERN int internalHostnameIs(const char *); -#if USE_CARP SQUIDCEXTERN void carpInit(void); extern void carpRegisterWithCacheManager(CacheManager & manager); SQUIDCEXTERN peer *carpSelectParent(HttpRequest *); -#endif #if USE_LEAKFINDER diff --git a/src/structs.h b/src/structs.h index 97b055e5d13..3a4b22321c0 100755 --- a/src/structs.h +++ b/src/structs.h @@ -929,9 +929,7 @@ struct peer unsigned int no_delay:1; #endif unsigned int allow_miss:1; -#if USE_CARP unsigned int carp:1; -#endif unsigned int originserver:1; } options; @@ -966,7 +964,6 @@ struct peer int rr_lastcount; peer *next; int test_fd; -#if USE_CARP struct { @@ -974,7 +971,6 @@ struct peer double load_multiplier; double load_factor; /* normalized weight value */ } carp; -#endif char *login; /* Proxy authorization */ time_t connect_timeout;