[MEDIUM] implement the URI hash algorithm
Guillaume Dallaire contributed the URI hashing algorithm for
use with proxy-caches. It provides the advantage of optimizing
the cache hit rate.
diff --git a/src/backend.c b/src/backend.c
index b357646..bb57050 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -187,6 +187,12 @@
(void *)&((struct sockaddr_in *)&s->cli_addr)->sin_addr,
len);
}
+ else if (s->be->options & PR_O_BALANCE_UH) {
+ /* URI hashing */
+ s->srv = get_server_uh(s->be,
+ s->txn.req.sol + s->txn.req.sl.rq.u,
+ s->txn.req.sl.rq.u_l);
+ }
else /* unknown balancing algorithm */
return SRV_STATUS_INTERNAL;
}