BUG: vars: Fix 'set-var' converter because of a typo
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 9 Nov 2016 15:15:32 +0000 (16:15 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 9 Nov 2016 21:50:54 +0000 (22:50 +0100)
commit0099a8ca9d58cb4cff943bf6374b55b42a23fbfb
tree503b6842c08fe866c710b19f4b6949a4753c3e5c
parente5a60688a4f8d767e56e78e74481c7eef9ed47d5
BUG: vars: Fix 'set-var' converter because of a typo

The 'set-var' converter uses function smp_conv_store (vars.c). In this function,
we should use the first argument (index 0) to retrieve the variable name and its
scope. But because of a typo, we get the scope of the second argument (index
1). In this case, there is no second argument. So the scope used was always 0
(SCOPE_SESS), always setting the variable in the session scope.

So, due to this bug, this rules

  tcp-request content accept if { src,set-var(txn.foo) -m found }

always set the variable 'sess.foo' instead of 'txn.foo'.
src/vars.c