mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2025-02-02 15:07:36 -05:00
Fix an fserv crash bug if startup failed, and fix an fserv-didn't-actually-
work-at-all-in-most-circumstances bug. svn path=/trunk/icecast/; revision=3883
This commit is contained in:
parent
b2c59ffdd5
commit
08061569bd
@ -47,7 +47,7 @@
|
|||||||
|
|
||||||
static avl_tree *client_tree;
|
static avl_tree *client_tree;
|
||||||
static avl_tree *pending_tree;
|
static avl_tree *pending_tree;
|
||||||
static avl_tree *mimetypes;
|
static avl_tree *mimetypes = NULL;
|
||||||
|
|
||||||
static cond_t fserv_cond;
|
static cond_t fserv_cond;
|
||||||
static thread_t *fserv_thread;
|
static thread_t *fserv_thread;
|
||||||
@ -98,6 +98,9 @@ void fserve_shutdown(void)
|
|||||||
if(!config_get_config()->fileserve)
|
if(!config_get_config()->fileserve)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if(!run_fserv)
|
||||||
|
return;
|
||||||
|
|
||||||
avl_tree_free(mimetypes, _delete_mapping);
|
avl_tree_free(mimetypes, _delete_mapping);
|
||||||
|
|
||||||
run_fserv = 0;
|
run_fserv = 0;
|
||||||
@ -136,6 +139,7 @@ static void wait_for_fds() {
|
|||||||
return;
|
return;
|
||||||
#else
|
#else
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
|
fd_set realfds;
|
||||||
tv.tv_sec = 0;
|
tv.tv_sec = 0;
|
||||||
tv.tv_usec = 200000;
|
tv.tv_usec = 200000;
|
||||||
if(client_tree_changed) {
|
if(client_tree_changed) {
|
||||||
@ -155,7 +159,8 @@ static void wait_for_fds() {
|
|||||||
avl_tree_unlock(client_tree);
|
avl_tree_unlock(client_tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(select(fd_max+1, NULL, &fds, NULL, &tv) > 0)
|
memcpy(&realfds, &fds, sizeof(fd_set));
|
||||||
|
if(select(fd_max+1, NULL, &realfds, NULL, &tv) > 0)
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
else {
|
else {
|
||||||
|
Loading…
Reference in New Issue
Block a user