]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Round Robin parenting
authorwessels <>
Sat, 1 Feb 1997 04:03:09 +0000 (04:03 +0000)
committerwessels <>
Sat, 1 Feb 1997 04:03:09 +0000 (04:03 +0000)
src/cache_cf.cc
src/neighbors.cc

index 948dfef59f6fe569bc46a83ade48b3020b917ef8..10de52f6238231d15200d70e2a602c1b99a001c1 100644 (file)
@@ -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();
index cba1d3bd802105683e0444caf990fdbc5af102df..401ab3dae2357fd1d4f154abad9f65d5b011ca3e 100644 (file)
@@ -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)
 {