MEDIUM: acl: use temp_pattern to store any address-type information

IPv4 and IPv6 addresses are now stored into temp_pattern instead of
the dirty hack consisting into storing them into the consumer's target
address.

Some refactoring should now be possible since the methods used to fetch
source and destination addresses are similar between patterns and ACLs.
diff --git a/src/proto_http.c b/src/proto_http.c
index 133d916..b60048e 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -7967,8 +7967,10 @@
 
 	/* Parse HTTP request */
 	url2sa(txn->req.sol + txn->req.sl.rq.u, txn->req.sl.rq.u_l, &l4->req->cons->addr.to);
-	test->ptr = (void *)&((struct sockaddr_in *)&l4->req->cons->addr.to)->sin_addr;
-	test->i = AF_INET;
+	if (((struct sockaddr_in *)&l4->req->cons->addr.to)->sin_family != AF_INET)
+		return 0;
+	temp_pattern.type = PATTERN_TYPE_IP;
+	temp_pattern.data.ip = ((struct sockaddr_in *)&l4->req->cons->addr.to)->sin_addr;
 
 	/*
 	 * If we are parsing url in frontend space, we prepare backend stage
@@ -7977,7 +7979,7 @@
 	if (px->options & PR_O_HTTP_PROXY)
 		l4->flags |= SN_ADDR_SET;
 
-	test->flags = ACL_TEST_F_READ_ONLY;
+	test->flags = 0;
 	return 1;
 }
 
@@ -8215,15 +8217,14 @@
 		/* search for header from the beginning */
 		ctx->idx = 0;
 
-	if (http_find_header2(expr->arg.str, expr->arg_len, sol, idx, ctx)) {
+	while (http_find_header2(expr->arg.str, expr->arg_len, sol, idx, ctx)) {
 		test->flags |= ACL_TEST_F_FETCH_MORE;
 		test->flags |= ACL_TEST_F_VOL_HDR;
 		/* Same optimization as url_ip */
-		memset(&((struct sockaddr_in *)&l4->req->cons->addr.to)->sin_addr, 0, sizeof(((struct sockaddr_in *)&l4->req->cons->addr.to)->sin_addr));
-		url2ipv4((char *)ctx->line + ctx->val, &((struct sockaddr_in *)&l4->req->cons->addr.to)->sin_addr);
-		test->ptr = (void *)&((struct sockaddr_in *)&l4->req->cons->addr.to)->sin_addr;
-		test->i = AF_INET;
-		return 1;
+		temp_pattern.type = PATTERN_TYPE_IP;
+		if (url2ipv4((char *)ctx->line + ctx->val, &temp_pattern.data.ip))
+			return 1;
+		/* Dods not look like an IP address, let's fetch next one */
 	}
 
 	test->flags &= ~ACL_TEST_F_FETCH_MORE;