]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: sample: provide the original sample_conv descriptor struct to the argument...
authorThierry FOURNIER <tfournier@exceliance.fr>
Thu, 21 Nov 2013 12:37:41 +0000 (13:37 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 2 Dec 2013 22:31:32 +0000 (23:31 +0100)
Note that this argument checker is still unused but will be used by
maps.

include/types/sample.h
src/acl.c
src/sample.c

index 956e7946b349ac70c5e5fd55f70a35c90b164439..2f211978d4929f2e442f48d6367a457cc704d5c7 100644 (file)
@@ -243,6 +243,7 @@ struct sample_conv {
                       struct sample *smp);       /* process function */
        unsigned int arg_mask;                    /* arguments (ARG*()) */
        int (*val_args)(struct arg *arg_p,
+                       struct sample_conv *smp_conv,
                        char **err_msg);          /* argument validation function */
        unsigned int in_type;                     /* expected input sample type */
        unsigned int out_type;                    /* output sample type */
index 9f487a309b55e2808184b950c37cbe3f21cad82c..9ea082a303b826f20383f36ef7ae4d5172603228 100644 (file)
--- a/src/acl.c
+++ b/src/acl.c
@@ -1277,7 +1277,7 @@ struct acl_expr *parse_acl_expr(const char **args, char **err, struct arg_list *
                                        if (!conv_expr->arg_p)
                                                conv_expr->arg_p = empty_arg_list;
 
-                                       if (conv->val_args && !conv->val_args(conv_expr->arg_p, &err_msg)) {
+                                       if (conv->val_args && !conv->val_args(conv_expr->arg_p, conv, &err_msg)) {
                                                memprintf(err, "ACL keyword '%s' : invalid args in conv method '%s' : %s.",
                                                          expr->kw, ckw, err_msg);
                                                free(err_msg);
index ac0e52a80cb519db9600689750d3f753ce3e174f..162c9495371470013e391bd12fc20b4477084e5a 100644 (file)
@@ -745,7 +745,7 @@ struct sample_expr *sample_parse_expr(char **str, int *idx, char *err, int err_s
                        if (!conv_expr->arg_p)
                                conv_expr->arg_p = empty_arg_list;
 
-                       if (conv->val_args && !conv->val_args(conv_expr->arg_p, &err_msg)) {
+                       if (conv->val_args && !conv->val_args(conv_expr->arg_p, conv, &err_msg)) {
                                snprintf(err, err_size, "invalid args in conv method '%s' : %s.", ckw, err_msg);
                                free(err_msg);
                                goto out_error;