From: Willy Tarreau Date: Fri, 19 Apr 2019 14:28:53 +0000 (+0200) Subject: MINOR: wurfl: indicate in haproxy -vv the wurfl version in use X-Git-Tag: v2.0-dev3~202 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b518823f1b6c23e4d58953cc8a6cbdec7629b66f;p=thirdparty%2Fhaproxy.git 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) --- 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);