[MEDIUM] add support for URI hash depth and length limits

This patch adds two optional arguments "len" and "depth" to
"balance uri". They are used to limit the length in characters
of the analysis, as well as the number of directory components
it applies to.
diff --git a/include/proto/backend.h b/include/proto/backend.h
index 03fa518..aa27654 100644
--- a/include/proto/backend.h
+++ b/include/proto/backend.h
@@ -159,6 +159,7 @@
 {
 	unsigned long hash = 0;
 	int c;
+	int slashes = 0;
 
 	if (px->lbprm.tot_weight == 0)
 		return NULL;
@@ -166,10 +167,19 @@
 	if (px->lbprm.map.state & PR_MAP_RECALC)
 		recalc_server_map(px);
 
+	if (px->uri_len_limit)
+		uri_len = MIN(uri_len, px->uri_len_limit);
+
 	while (uri_len--) {
 		c = *uri++;
-		if (c == '?')
+		if (c == '/') {
+			slashes++;
+			if (slashes == px->uri_dirs_depth1) /* depth+1 */
+				break;
+		}
+		else if (c == '?')
 			break;
+
 		hash = c + (hash << 6) + (hash << 16) - hash;
 	}