BUG/MINOR: vars: properly set the argument parsing context in the expression
authorWilly Tarreau <w@1wt.eu>
Thu, 2 Sep 2021 17:46:08 +0000 (19:46 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 2 Sep 2021 18:34:30 +0000 (20:34 +0200)
commit54b96d99556a27e15ee77b8b498d011cda2771e9
tree40dde96b34aa587d7d1e425d0ab195f428ed96b0
parent57467b83565b9c3e112053c92ede66113809d458
BUG/MINOR: vars: properly set the argument parsing context in the expression

When the expression called in "set-var" uses argments that require late
resolution, the context must be set. At the moment, any unknown argument
is misleadingly reported as "ACL":

    frontend f
        bind :8080
        mode http
        http-request set-var(proc.a) be_conn(foo)

   parsing [b1.cfg:4]: unable to find backend 'foo' referenced in arg 1 \
   of ACL keyword 'be_conn' in proxy 'f'.

Once the context is properly set, it now says the truth:

   parsing [b1.cfg:8]: unable to find backend 'foo' referenced in arg 1 \
   of sample fetch keyword 'be_conn' in http-request expression in proxy 'f'.

This may be backported but is not really important. If so, the preceeding
patches "BUG/MINOR: vars: improve accuracy of the rules used to check
expression validity" and "MINOR: sample: add missing ARGC_ entries" must
be backported as well.
src/vars.c