1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-12-04 14:46:30 -05:00

Update: Make use of igloo_initialize()

This commit is contained in:
Philipp Schafft 2018-11-01 11:23:32 +00:00
parent 6f40700abd
commit 196b67a9a3

View File

@ -44,6 +44,8 @@
#include <sys/utsname.h> #include <sys/utsname.h>
#endif #endif
#include <igloo/igloo.h>
#include <igloo/ro.h>
#include <igloo/thread.h> #include <igloo/thread.h>
#include <igloo/sock.h> #include <igloo/sock.h>
#include <igloo/resolver.h> #include <igloo/resolver.h>
@ -88,6 +90,8 @@
static int background; static int background;
static char *pidfile = NULL; static char *pidfile = NULL;
static igloo_ro_t icecast_igloo_instance;
static void pidfile_update(ice_config_t *config, int always_try); static void pidfile_update(ice_config_t *config, int always_try);
static void _fatal_error(const char *perr) static void _fatal_error(const char *perr)
@ -142,15 +146,14 @@ static refobject_t fastevent_reg;
static void initialize_subsystems(void) static void initialize_subsystems(void)
{ {
igloo_log_initialize(); icecast_igloo_instance = igloo_initialize();
igloo_thread_initialize(); /* FIXME: Check for igloo_RO_IS_NULL(icecast_igloo_instance) */
global_initialize(); global_initialize();
#ifndef FASTEVENT_ENABLED #ifndef FASTEVENT_ENABLED
fastevent_initialize(); fastevent_initialize();
fastevent_reg = fastevent_register(FASTEVENT_TYPE_SLOWEVENT, __fastevent_cb, NULL, NULL); fastevent_reg = fastevent_register(FASTEVENT_TYPE_SLOWEVENT, __fastevent_cb, NULL, NULL);
#endif #endif
igloo_sock_initialize();
igloo_resolver_initialize();
config_initialize(); config_initialize();
tls_initialize(); tls_initialize();
connection_initialize(); connection_initialize();
@ -175,14 +178,11 @@ static void shutdown_subsystems(void)
connection_shutdown(); connection_shutdown();
tls_shutdown(); tls_shutdown();
config_shutdown(); config_shutdown();
igloo_resolver_shutdown();
igloo_sock_shutdown();
#ifndef FASTEVENT_ENABLED #ifndef FASTEVENT_ENABLED
refobject_unref(fastevent_reg); refobject_unref(fastevent_reg);
fastevent_shutdown(); fastevent_shutdown();
#endif #endif
global_shutdown(); global_shutdown();
igloo_thread_shutdown();
#ifdef HAVE_CURL #ifdef HAVE_CURL
icecast_curl_shutdown(); icecast_curl_shutdown();
@ -190,8 +190,9 @@ static void shutdown_subsystems(void)
/* Now that these are done, we can stop the loggers. */ /* Now that these are done, we can stop the loggers. */
_stop_logging(); _stop_logging();
igloo_log_shutdown();
xslt_shutdown(); xslt_shutdown();
igloo_ro_unref(icecast_igloo_instance);
} }
void main_config_reload(ice_config_t *config) void main_config_reload(ice_config_t *config)