Skip to content

Commit

Permalink
Remove the --disable-carp option, keeping the CARP code always compil…
Browse files Browse the repository at this point in the history
…ed 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.
  • Loading branch information
hno committed Jul 11, 2008
1 parent 10b0676 commit b2ea838
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 35 deletions.
12 changes: 0 additions & 12 deletions configure.in
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion squid3.dox
Expand Up @@ -1018,7 +1018,6 @@ PREDEFINED = \
USE_ARP_ACL \
USE_ASYNC_IO \
USE_CACHE_DIGESTS \
USE_CARP \
USE_CLASSFUL \
USE_DLMALLOC \
USE_DNSSERVERS \
Expand Down
2 changes: 0 additions & 2 deletions src/cache_cf.cc
Expand Up @@ -1733,15 +1733,13 @@ 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)
fatalf("parse_peer: non-parent carp peer %s/%d\n", p->host, p->http_port);

p->options.carp = 1;

#endif
#if DELAY_POOLS

} else if (!strcasecmp(token, "no-delay")) {
Expand Down
4 changes: 0 additions & 4 deletions src/carp.cc
Expand Up @@ -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;
Expand Down Expand Up @@ -227,5 +225,3 @@ carpCachemgr(StoreEntry * sentry)
sumfetches ? (double) p->stats.fetches / sumfetches : -1.0);
}
}

#endif
2 changes: 0 additions & 2 deletions src/enums.h
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions src/main.cc
Expand Up @@ -626,10 +626,8 @@ serverConnectionsOpen(void)
asnInit();
ACL::Initialize();
peerSelectInit();
#if USE_CARP

carpInit();
#endif
}

void
Expand Down
6 changes: 0 additions & 6 deletions src/peer_select.cc
Expand Up @@ -63,9 +63,7 @@ const char *hier_strings[] =
"CD_PARENT_HIT",
"CD_SIBLING_HIT",
#endif
#if USE_CARP
"CARP",
#endif
"ANY_PARENT",
"INVALID CODE"
};
Expand Down Expand Up @@ -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))) {
Expand Down
2 changes: 0 additions & 2 deletions src/protos.h
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions src/structs.h
Expand Up @@ -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;

Expand Down Expand Up @@ -966,15 +964,13 @@ struct peer
int rr_lastcount;
peer *next;
int test_fd;
#if USE_CARP

struct
{
unsigned int hash;
double load_multiplier;
double load_factor; /* normalized weight value */
} carp;
#endif

char *login; /* Proxy authorization */
time_t connect_timeout;
Expand Down

0 comments on commit b2ea838

Please sign in to comment.