acl_access *access;
struct {
- unsigned int proxy_only:1;
- unsigned int no_query:1;
- unsigned int background_ping:1;
- unsigned int no_digest:1;
- unsigned int default_parent:1;
- unsigned int roundrobin:1;
- unsigned int weighted_roundrobin:1;
- unsigned int mcast_responder:1;
- unsigned int closest_only:1;
+ bool proxy_only;
+ bool no_query;
+ bool background_ping;
+ bool no_digest;
+ bool default_parent;
+ bool roundrobin;
+ bool weighted_roundrobin;
+ bool mcast_responder;
+ bool closest_only;
#if USE_HTCP
- unsigned int htcp:1;
- unsigned int htcp_oldsquid:1;
- unsigned int htcp_no_clr:1;
- unsigned int htcp_no_purge_clr:1;
- unsigned int htcp_only_clr:1;
- unsigned int htcp_forward_clr:1;
+ bool htcp;
+ bool htcp_oldsquid;
+ bool htcp_no_clr;
+ bool htcp_no_purge_clr;
+ bool htcp_only_clr;
+ bool htcp_forward_clr;
#endif
- unsigned int no_netdb_exchange:1;
+ bool no_netdb_exchange;
#if USE_DELAY_POOLS
- unsigned int no_delay:1;
+ bool no_delay;
#endif
- unsigned int allow_miss:1;
- unsigned int carp:1;
+ bool allow_miss;
+ bool carp;
struct {
- unsigned int set:1; //If false, whole url is to be used. Overrides others
- unsigned int scheme:1;
- unsigned int host:1;
- unsigned int port:1;
- unsigned int path:1;
- unsigned int params:1;
+ bool set; //If false, whole url is to be used. Overrides others
+ bool scheme;
+ bool host;
+ bool port;
+ bool path;
+ bool params;
} carp_key;
#if USE_AUTH
- unsigned int userhash:1;
+ bool userhash;
#endif
- unsigned int sourcehash:1;
- unsigned int originserver:1;
- unsigned int no_tproxy:1;
+ bool sourcehash;
+ bool originserver;
+ bool no_tproxy;
#if PEER_MULTICAST_SIBLINGS
- unsigned int mcast_siblings:1;
+ bool mcast_siblings;
#endif
} options;
int id;
struct {
- unsigned int count_event_pending:1;
- unsigned int counting:1;
+ bool count_event_pending;
+ bool counting;
} flags;
} mcast;
#if USE_CACHE_DIGESTS
p->type = parseNeighborType(token);
if (p->type == PEER_MULTICAST) {
- p->options.no_digest = 1;
- p->options.no_netdb_exchange = 1;
+ p->options.no_digest = true;
+ p->options.no_netdb_exchange = true;
}
p->http_port = GetTcpService();
while ((token = strtok(NULL, w_space))) {
if (!strcasecmp(token, "proxy-only")) {
- p->options.proxy_only = 1;
+ p->options.proxy_only = true;
} else if (!strcasecmp(token, "no-query")) {
- p->options.no_query = 1;
+ p->options.no_query = true;
} else if (!strcasecmp(token, "background-ping")) {
- p->options.background_ping = 1;
+ p->options.background_ping = true;
} else if (!strcasecmp(token, "no-digest")) {
- p->options.no_digest = 1;
+ p->options.no_digest = true;
} else if (!strcasecmp(token, "no-tproxy")) {
- p->options.no_tproxy = 1;
+ p->options.no_tproxy = true;
} else if (!strcasecmp(token, "multicast-responder")) {
- p->options.mcast_responder = 1;
+ p->options.mcast_responder = true;
#if PEER_MULTICAST_SIBLINGS
} else if (!strcasecmp(token, "multicast-siblings")) {
- p->options.mcast_siblings = 1;
+ p->options.mcast_siblings = true;
#endif
} else if (!strncasecmp(token, "weight=", 7)) {
p->weight = xatoi(token + 7);
} else if (!strncasecmp(token, "basetime=", 9)) {
p->basetime = xatoi(token + 9);
} else if (!strcasecmp(token, "closest-only")) {
- p->options.closest_only = 1;
+ p->options.closest_only = true;
} else if (!strncasecmp(token, "ttl=", 4)) {
p->mcast.ttl = xatoi(token + 4);
if (p->mcast.ttl > 128)
p->mcast.ttl = 128;
} else if (!strcasecmp(token, "default")) {
- p->options.default_parent = 1;
+ p->options.default_parent = true;
} else if (!strcasecmp(token, "round-robin")) {
- p->options.roundrobin = 1;
+ p->options.roundrobin = true;
} else if (!strcasecmp(token, "weighted-round-robin")) {
- p->options.weighted_roundrobin = 1;
+ p->options.weighted_roundrobin = true;
#if USE_HTCP
} else if (!strcasecmp(token, "htcp")) {
- p->options.htcp = 1;
+ p->options.htcp = true;
} else if (!strncasecmp(token, "htcp=", 5) || !strncasecmp(token, "htcp-", 5)) {
/* Note: The htcp- form is deprecated, replaced by htcp= */
- p->options.htcp = 1;
+ p->options.htcp = true;
char *tmp = xstrdup(token+5);
char *mode, *nextmode;
for (mode = nextmode = tmp; mode; mode = nextmode) {
if (!strcasecmp(mode, "no-clr")) {
if (p->options.htcp_only_clr)
fatalf("parse_peer: can't set htcp-no-clr and htcp-only-clr simultaneously");
- p->options.htcp_no_clr = 1;
+ p->options.htcp_no_clr = true;
} else if (!strcasecmp(mode, "no-purge-clr")) {
- p->options.htcp_no_purge_clr = 1;
+ p->options.htcp_no_purge_clr = true;
} else if (!strcasecmp(mode, "only-clr")) {
if (p->options.htcp_no_clr)
fatalf("parse_peer: can't set htcp no-clr and only-clr simultaneously");
- p->options.htcp_only_clr = 1;
+ p->options.htcp_only_clr = true;
} else if (!strcasecmp(mode, "forward-clr")) {
- p->options.htcp_forward_clr = 1;
+ p->options.htcp_forward_clr = true;
} else if (!strcasecmp(mode, "oldsquid")) {
- p->options.htcp_oldsquid = 1;
+ p->options.htcp_oldsquid = true;
} else {
fatalf("invalid HTCP mode '%s'", mode);
}
safe_free(tmp);
#endif
} else if (!strcasecmp(token, "no-netdb-exchange")) {
- p->options.no_netdb_exchange = 1;
+ p->options.no_netdb_exchange = true;
} 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;
+ p->options.carp = true;
} else if (!strncasecmp(token, "carp-key=", 9)) {
- if (p->options.carp != 1)
+ if (p->options.carp != true)
fatalf("parse_peer: carp-key specified on non-carp peer %s/%d\n", p->host, p->http_port);
- p->options.carp_key.set=1;
+ p->options.carp_key.set = true;
char *nextkey=token+strlen("carp-key="), *key=nextkey;
for (; key; key = nextkey) {
nextkey=strchr(key,',');
if (nextkey) ++nextkey; // skip the comma, any
if (0==strncasecmp(key,"scheme",6)) {
- p->options.carp_key.scheme=1;
+ p->options.carp_key.scheme = true;
} else if (0==strncasecmp(key,"host",4)) {
- p->options.carp_key.host=1;
+ p->options.carp_key.host = true;
} else if (0==strncasecmp(key,"port",4)) {
- p->options.carp_key.port=1;
+ p->options.carp_key.port = true;
} else if (0==strncasecmp(key,"path",4)) {
- p->options.carp_key.path=1;
+ p->options.carp_key.path = true;
} else if (0==strncasecmp(key,"params",6)) {
- p->options.carp_key.params=1;
+ p->options.carp_key.params = true;
} else {
fatalf("invalid carp-key '%s'",key);
}
if (p->type != PEER_PARENT)
fatalf("parse_peer: non-parent userhash peer %s/%d\n", p->host, p->http_port);
- p->options.userhash = 1;
+ p->options.userhash = true;
#else
fatalf("parse_peer: userhash requires authentication. peer %s/%d\n", p->host, p->http_port);
#endif
if (p->type != PEER_PARENT)
fatalf("parse_peer: non-parent sourcehash peer %s/%d\n", p->host, p->http_port);
- p->options.sourcehash = 1;
+ p->options.sourcehash = true;
} else if (!strcasecmp(token, "no-delay")) {
#if USE_DELAY_POOLS
- p->options.no_delay = 1;
+ p->options.no_delay = true;
#else
debugs(0, DBG_CRITICAL, "WARNING: cache_peer option 'no-delay' requires --enable-delay-pools");
#endif
#endif
} else if (!strcasecmp(token, "allow-miss")) {
- p->options.allow_miss = 1;
+ p->options.allow_miss = true;
} else if (!strncasecmp(token, "max-conn=", 9)) {
p->max_conn = xatoi(token + 9);
} else if (!strcasecmp(token, "originserver")) {
- p->options.originserver = 1;
+ p->options.originserver = true;
} else if (!strncasecmp(token, "name=", 5)) {
safe_free(p->name);