]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: wurfl: indicate in haproxy -vv the wurfl version in use
authorWilly Tarreau <w@1wt.eu>
Fri, 19 Apr 2019 14:28:53 +0000 (16:28 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 23 Apr 2019 09:00:23 +0000 (11:00 +0200)
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

index 75dcf0045f3e83c194a079487ec5c7f2b18b96d1..5c490f7d67af204ec062a9531c387ed9f668706c 100644 (file)
@@ -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);