]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
Revert "MEDIUM: sample: Small fix in function check_operator for eror reporting"
authorRemi Tricot-Le Breton <rlebreton@haproxy.com>
Mon, 2 Oct 2023 15:46:54 +0000 (17:46 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 3 Oct 2023 09:13:10 +0000 (11:13 +0200)
This reverts commit d897d7da87b8894866572c56e9c495a2b290620a.

The "check_operator" function is used for all the operator converters
such as "and", "or", "add"...
With such a converter that accepts a variable name as well as an
integer, the "vars_check_arg" call is expected to fail when an integer
is provided. Passing an "err" variable has the unwanted side effect of
raising a warning during init for a configuration such as the following:

    http-request set-query "s=%[rand,add(20)]"

which raises the following warning:
    [WARNING]  (33040) : config : parsing [hap.cfg:14] : invalid
    variable name '20'. A variable name must be start by its scope. The
    scope can be 'proc', 'sess', 'txn', 'req', 'res' or 'check'.

src/sample.c

index 6e860f31ee56dceeefda152807cb9760d318ba69..bb7db28e797798e17f27b9f0f8e0bd360b78f65c 100644 (file)
@@ -3156,7 +3156,7 @@ static int check_operator(struct arg *args, struct sample_conv *conv,
        long long int i;
 
        /* Try to decode a variable. */
-       if (vars_check_arg(&args[0], err))
+       if (vars_check_arg(&args[0], NULL))
                return 1;
 
        /* Try to convert an integer */