/*
- * $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
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();
/*
- * $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
"PARENT_UDP_HIT_OBJ",
"PASSTHROUGH_PARENT",
"SSL_PARENT_MISS",
+ "ROUNDROBIN_PARENT",
"INVALID CODE"
};
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)
{