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.
This commit is contained in:
Thierry FOURNIER 2013-11-21 13:37:41 +01:00 committed by Willy Tarreau
parent e6b11e47c5
commit 9c1d67ecbd
3 changed files with 3 additions and 2 deletions

View 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 */

View File

@ -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);

View 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;