[MINOR] report in the proxies the requirements for ACLs
This patch propagates the ACL conditions' "requires" bitfield
to the proxies. This makes it possible to know exactly what a
proxy might have to support for any request, which helps knowing
whether we have to allocate some space for certain types of
structures or not (eg: the hdr_idx struct).
The concept might be extended to a lot more types of information,
such as detecting whether we need to allocate some space for some
request ACLs which need a result in the response, etc...
diff --git a/src/cfgparse.c b/src/cfgparse.c
index 5afb11e..a7dbe02 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -1360,6 +1360,7 @@
return -1;
}
cond->line = linenum;
+ curproxy->acl_requires |= cond->requires;
LIST_ADDQ(&curproxy->block_cond, &cond->list);
warnif_misplaced_block(curproxy, file, linenum, args[0]);
}
@@ -1475,6 +1476,7 @@
}
cond->line = linenum;
+ curproxy->acl_requires |= cond->requires;
rule = (struct redirect_rule *)calloc(1, sizeof(*rule));
rule->cond = cond;
rule->rdr_str = strdup(destination);
@@ -1536,6 +1538,7 @@
}
cond->line = linenum;
+ curproxy->acl_requires |= cond->requires;
if (cond->requires & ACL_USE_RTR_ANY) {
struct acl *acl;
const char *name;
@@ -1921,6 +1924,7 @@
return -1;
}
cond->line = linenum;
+ curproxy->acl_requires |= cond->requires;
LIST_ADDQ(&curproxy->mon_fail_cond, &cond->list);
}
else {
@@ -3442,6 +3446,7 @@
break;
case PR_MODE_HTTP:
+ curproxy->acl_requires |= ACL_USE_L7_ANY;
if ((curproxy->cookie_name != NULL) && (curproxy->srv == NULL)) {
Alert("config : HTTP proxy %s has a cookie but no server list !\n",
curproxy->id);