]> git.ipfire.org Git - thirdparty/haproxy.git/commit
CLEANUP: sample: generalize sample_fetch_string() as sample_fetch_as_type()
authorAdis Nezirovic <anezirovic@haproxy.com>
Mon, 6 Jul 2015 13:41:02 +0000 (15:41 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 6 Jul 2015 14:17:25 +0000 (16:17 +0200)
commit79beb248b921da45ddfe148e1daeffea880c57d0
tree2641dca826c3d4a23ae3faf8aa25e037cbcbfc97
parent4e5d58e5177a88513215b85971d164f92de397c3
CLEANUP: sample: generalize sample_fetch_string() as sample_fetch_as_type()

This modification makes possible to use sample_fetch_string() in more places,
where we might need to fetch sample values which are not plain strings. This
way we don't need to fetch string, and convert it into another type afterwards.

When using aliased types, the caller should explicitly check which exact type
was returned (e.g. SMP_T_IPV4 or SMP_T_IPV6 for SMP_T_ADDR).

All usages of sample_fetch_string() are converted to use new function.
include/proto/sample.h
src/log.c
src/proto_http.c
src/proto_tcp.c
src/sample.c