CLEANUP: wurfl: register the deinit function via the dedicated list
By registering the deinit function we avoid another #ifdef in haproxy.c.
The ha_wurfl_deinit() function has been made static and unexported. Now
proto/wurfl.h is totally empty, the code being self-contained in wurfl.c,
so the useless .h has been removed.
diff --git a/include/proto/wurfl.h b/include/proto/wurfl.h
deleted file mode 100644
index 2dac8de..0000000
--- a/include/proto/wurfl.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _PROTO_WURFL_H
-#define _PROTO_WURFL_H
-
-void ha_wurfl_deinit(void);
-
-#endif
diff --git a/src/haproxy.c b/src/haproxy.c
index 06fc895..b222b09 100644
--- a/src/haproxy.c
+++ b/src/haproxy.c
@@ -113,10 +113,6 @@
#include <proto/ssl_sock.h>
#endif
-#ifdef USE_WURFL
-#include <proto/wurfl.h>
-#endif
-
#ifdef USE_DEVICEATLAS
#include <import/da.h>
#endif
@@ -1587,10 +1583,6 @@
deinit_51degrees();
#endif
-#ifdef USE_WURFL
- ha_wurfl_deinit();
-#endif
-
list_for_each_entry(pdf, &post_deinit_list, list)
pdf->fct();
diff --git a/src/wurfl.c b/src/wurfl.c
index 37205a4..2b4a28d 100644
--- a/src/wurfl.c
+++ b/src/wurfl.c
@@ -9,7 +9,6 @@
#include <proto/log.h>
#include <proto/proto_http.h>
#include <proto/sample.h>
-#include <proto/wurfl.h>
#include <ebsttree.h>
#include <ebmbtree.h>
@@ -475,7 +474,7 @@
return 0;
}
-void ha_wurfl_deinit(void)
+static void ha_wurfl_deinit(void)
{
wurfl_information_t *wi, *wi2;
wurfl_patches_t *wp, *wp2;
@@ -675,6 +674,7 @@
cfg_register_keywords(&wurflcfg_kws);
hap_register_build_opts("Built with WURFL support.", 0);
hap_register_post_check(ha_wurfl_init);
+ hap_register_post_deinit(ha_wurfl_deinit);
}
// WURFL properties wrapper functions