From b518823f1b6c23e4d58953cc8a6cbdec7629b66f Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 19 Apr 2019 16:28:53 +0200 Subject: [PATCH] MINOR: wurfl: indicate in haproxy -vv the wurfl version in use It also explicitly mentions that the library is the dummy one when it is detected. We have this output now : $ ./haproxy -vv |grep -i wurfl Built with WURFL support (dummy library version 1.11.2.100) --- src/wurfl.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/wurfl.c b/src/wurfl.c index 75dcf0045f..5c490f7d67 100644 --- a/src/wurfl.c +++ b/src/wurfl.c @@ -795,6 +795,17 @@ static const char *ha_wurfl_retrieve_header(const char *header_name, const void return ((ha_wurfl_header_t *)wh)->header_value; } +static void ha_wurfl_register_build_options() +{ + const char *ver = wurfl_get_api_version(); + char *ptr = NULL; + + memprintf(&ptr, "Built with WURFL support (%sversion %s)", + strcmp(ver, "1.11.2.100") ? "" : "dummy library ", + ver); + hap_register_build_opts(ptr, 1); +} + REGISTER_POST_CHECK(ha_wurfl_init); REGISTER_POST_DEINIT(ha_wurfl_deinit); -REGISTER_BUILD_OPTS("Built with WURFL support."); +INITCALL0(STG_REGISTER, ha_wurfl_register_build_options);