1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-09-22 04:15:54 -04:00

Fix: Do not shut down fserve engine if not started up

This avoids a endless loop in a spin lock that has not been inited
yet if fserve engine was not started up by the time it was sent to
go down. This happened if icecast couldn't read the config because
the file was corrupted or non-existent.
Closes: #2144
This commit is contained in:
Philipp Schafft 2015-01-08 23:15:13 +00:00
parent 4e13c276f3
commit 130ef73aa3

View File

@ -69,6 +69,8 @@
#define BUFSIZE 4096
static volatile int __inited = 0;
static fserve_t *active_list = NULL;
static fserve_t *pending_list = NULL;
@ -107,12 +109,17 @@ void fserve_initialize(void)
fserve_recheck_mime_types (config);
config_release_config();
__inited = 1;
stats_event (NULL, "file_connections", "0");
ICECAST_LOG_INFO("file serving started");
}
void fserve_shutdown(void)
{
if (!__inited)
return;
thread_spin_lock (&pending_lock);
run_fserv = 0;
while (pending_list)