From: Thierry FOURNIER Date: Thu, 21 Nov 2013 12:37:41 +0000 (+0100) Subject: MINOR: sample: provide the original sample_conv descriptor struct to the argument... X-Git-Tag: v1.5-dev20~194 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9c1d67ecbdb37d1c48d172aeeb3c1d3439fa0e23;p=thirdparty%2Fhaproxy.git MINOR: sample: provide the original sample_conv descriptor struct to the argument checker function. Note that this argument checker is still unused but will be used by maps. --- diff --git a/include/types/sample.h b/include/types/sample.h index 956e7946b3..2f211978d4 100644 --- a/include/types/sample.h +++ b/include/types/sample.h @@ -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 */ diff --git a/src/acl.c b/src/acl.c index 9f487a309b..9ea082a303 100644 --- 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); diff --git a/src/sample.c b/src/sample.c index ac0e52a80c..162c949537 100644 --- a/src/sample.c +++ b/src/sample.c @@ -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;