]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: wurfl: register the deinit function via the dedicated list
authorWilly Tarreau <w@1wt.eu>
Wed, 21 Dec 2016 19:52:38 +0000 (20:52 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 21 Dec 2016 20:30:54 +0000 (21:30 +0100)
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.

include/proto/wurfl.h [deleted file]
src/haproxy.c
src/wurfl.c

diff --git a/include/proto/wurfl.h b/include/proto/wurfl.h
deleted file mode 100644 (file)
index 2dac8de..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _PROTO_WURFL_H
-#define _PROTO_WURFL_H
-
-void ha_wurfl_deinit(void);
-
-#endif
index 06fc895528b1a62bc66e6b7ffe7800cb117935b5..b222b095fa64b4734f903fd9467ecee233ad45d0 100644 (file)
 #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 @@ static void deinit(void)
        deinit_51degrees();
 #endif
 
-#ifdef USE_WURFL
-       ha_wurfl_deinit();
-#endif
-
        list_for_each_entry(pdf, &post_deinit_list, list)
                pdf->fct();
 
index 37205a4c1836145e30d090a9313ce7b11b059e33..2b4a28da0476fe9fb11ad7c63529b7c90e9d8744 100644 (file)
@@ -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 @@ static int ha_wurfl_init(void)
        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 @@ static void __wurfl_init(void)
        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