Commit 496e1a02 authored by Philipp Schafft's avatar Philipp Schafft 🦁

Update: Make use of igloo_initialize()

parent 42889cda
...@@ -44,6 +44,8 @@ ...@@ -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 @@ ...@@ -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; ...@@ -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) ...@@ -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) ...@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment