MAJOR: acl: make all ACLs reference the fetch function via a sample.
ACL fetch functions used to directly reference a fetch function. Now
that all ACL fetches have their sample fetches equivalent, we can make
ACLs reference a sample fetch keyword instead.
In order to simplify the code, a sample keyword name may be NULL if it
is the same as the ACL's, which is the most common case.
A minor change appeared, http_auth always expects one argument though
the ACL allowed it to be missing and reported as such afterwards, so
fix the ACL to match this. This is not really a bug.
diff --git a/include/types/acl.h b/include/types/acl.h
index 0cdcef2..fb457ca 100644
--- a/include/types/acl.h
+++ b/include/types/acl.h
@@ -233,14 +233,14 @@
struct acl_expr;
struct acl_keyword {
const char *kw;
+ char *fetch_kw;
int (*parse)(const char **text, struct acl_pattern *pattern, int *opaque, char **err);
- int (*fetch)(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
- const struct arg *args, struct sample *smp);
int (*match)(struct sample *smp, struct acl_pattern *pattern);
unsigned int requires; /* bit mask of all ACL_USE_* required to evaluate this keyword */
int arg_mask; /* mask describing up to 7 arg types */
int (*val_args)(struct arg *arg_p, char **err_msg); /* argument validation function */
/* must be after the config params */
+ struct sample_fetch *smp; /* the sample fetch we depend on */
int use_cnt;
};