]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: stick-tables: fix breakage in table converters
authorWilly Tarreau <w@1wt.eu>
Wed, 25 May 2016 15:07:56 +0000 (17:07 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 25 May 2016 15:13:48 +0000 (17:13 +0200)
commitf0c730a0ac21a64af666ffa32a336db2c6f56d1b
tree149e08234d1cbbc1d62817bac7a44d84cea5ede8
parent58727ec088e55f739b146cff3baa955f8d1b2a3e
BUG/MEDIUM: stick-tables: fix breakage in table converters

Baptiste reported that the table_conn_rate() converter would always
return zero in 1.6.5. In fact, commit bc8c404 ("MAJOR: stick-tables:
use sample types in place of dedicated types") broke all stick-table
converters because smp_to_stkey() now returns a pointer to the sample
instead of holding a copy of the key, and the converters used to
reinitialize the sample prior to performing the lookup. Only
"in_table()" continued to work.

The construct is still fragile, so some comments were added to a few
function to clarify their impacts. It's also worth noting that there
is no point anymore in forcing these converters to take a string on
input, but that will be changed in another commit.

The bug was introduced in 1.6-dev4, this fix must be backported to 1.6.
src/stick_table.c