MINOR: sample: provide a generic var-to-sample conversion function
authorWilly Tarreau <w@1wt.eu>
Wed, 6 Oct 2021 13:29:00 +0000 (15:29 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 19 Oct 2021 13:55:44 +0000 (15:55 +0200)
commit9ba1c9be16448c303e2a91c846b7891881b781a3
tree0be0b7450d64ed642227d30c94bb72a0978c1769
parent9aae43fb95a099f2c293f7fdfc343b55911da1e0
MINOR: sample: provide a generic var-to-sample conversion function

We're using variable-to-sample conversion at least 4 times in the code,
two of which are bogus. Let's introduce a generic conversion function
that performs the required checks.

(cherry picked from commit 168e8de1d06adc7aa3e7e2cc2a36935a77c79b9c)
[cf: call to vars_get_by_desc() was updated to remove the third param]
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit ea5735057fcf62c74b28fe3f13a0ab96b8014852)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
include/haproxy/sample.h
src/sample.c