]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: stick-table: change all stick-table converters' inputs to SMP_T_ANY
authorWilly Tarreau <w@1wt.eu>
Wed, 25 May 2016 15:16:38 +0000 (17:16 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 25 May 2016 15:20:59 +0000 (17:20 +0200)
commit2d17db589b1d6cf373e7117792e3485cd3a3560b
treefc292f23a12cac0eb49b9d8bb7cfa6215630871e
parentf0c730a0ac21a64af666ffa32a336db2c6f56d1b
MINOR: stick-table: change all stick-table converters' inputs to SMP_T_ANY

The stick-table converters used to take a string on input because it
was the only type that could be casted to from any other type. This is
inefficient and possibly inaccurate sometimes. For example in order to
look up an IP address, it must first be converted to a string then
converted back to an IP address.

We've had SMP_T_ANY introduced long ago in 1.6, but unfortunately it
was not propagated to these converters, so let's do it now.

It's important to note that a few direct type conversions which already
would not make any sense are not possible (for example, converting a
boolean to an IP address or an HTTP method to an integer). While this
would have caused the lookup to be performed on the wrong key, now the
lookup will fail and the converter will return no data. While there
should not be any case where this happens, it's probably best to avoid
backporting this change before a longer observation period.
src/stick_table.c