mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-05 19:52:14 +00:00
MINOR: acl: add a val_args field to keywords
This will make it possible to delegate argument validating to functions shared with smp_fetch_*.
This commit is contained in:
parent
7a777edbdf
commit
ae52f06da3
@ -235,6 +235,7 @@ struct acl_keyword {
|
||||
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 */
|
||||
int use_cnt;
|
||||
};
|
||||
|
@ -1271,6 +1271,9 @@ struct acl_expr *parse_acl_expr(const char **args)
|
||||
NULL, NULL, NULL);
|
||||
if (nbargs < 0)
|
||||
goto out_free_expr;
|
||||
|
||||
if (aclkw->val_args && !aclkw->val_args(expr->args, NULL))
|
||||
goto out_free_expr; /* invalid keyword argument */
|
||||
}
|
||||
else if (ARGM(aclkw->arg_mask) == 1) {
|
||||
int type = (aclkw->arg_mask >> 4) & 15;
|
||||
|
Loading…
Reference in New Issue
Block a user