From: wessels <> Date: Sat, 1 Feb 1997 04:03:09 +0000 (+0000) Subject: Round Robin parenting X-Git-Tag: SQUID_3_0_PRE1~5161 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=48b38d0116a0dc8ad4b5dd96087ff69d5567d1be;p=thirdparty%2Fsquid.git Round Robin parenting --- diff --git a/src/cache_cf.cc b/src/cache_cf.cc index 948dfef59f..10de52f623 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -1,5 +1,5 @@ /* - * $Id: cache_cf.cc,v 1.167 1997/01/22 17:01:23 wessels Exp $ + * $Id: cache_cf.cc,v 1.168 1997/01/31 21:03:09 wessels Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -497,6 +497,8 @@ parseCacheHostLine(void) mcast_ttl = atoi(token + 4); } else if (!strncasecmp(token, "default", 7)) { options |= NEIGHBOR_DEFAULT_PARENT; + } else if (!strncasecmp(token, "round-robin", 11)) { + options |= NEIGHBOR_ROUNDROBIN; } else { debug(3, 0, "parseCacheHostLine: token='%s'\n", token); self_destruct(); diff --git a/src/neighbors.cc b/src/neighbors.cc index cba1d3bd80..401ab3dae2 100644 --- a/src/neighbors.cc +++ b/src/neighbors.cc @@ -1,5 +1,5 @@ /* - * $Id: neighbors.cc,v 1.106 1997/01/24 08:16:18 wessels Exp $ + * $Id: neighbors.cc,v 1.107 1997/01/31 21:03:10 wessels Exp $ * * DEBUG: section 15 Neighbor Routines * AUTHOR: Harvest Derived @@ -145,6 +145,7 @@ const char *hier_strings[] = "PARENT_UDP_HIT_OBJ", "PASSTHROUGH_PARENT", "SSL_PARENT_MISS", + "ROUNDROBIN_PARENT", "INVALID CODE" }; @@ -272,6 +273,25 @@ getFirstUpParent(request_t * request) return NULL; } +edge * +getRoundRobinParent(request_t * request) +{ + edge *e; + edge *f = NULL; + for (e = friends.edges_head; e; e = e->next) { + if (!neighborUp(e)) + continue; + if (!BIT_TEST(e->options, NEIGHBOR_ROUNDROBIN)) + continue; + if (f && f->rr_count < e->rr_count) + continue; + f = e; + } + if (f) + f->rr_count++; + return f; +} + edge * getDefaultParent(request_t * request) {