Commit 89bf546a authored by Michael Smith's avatar Michael Smith

Lots of bugfixes contributed by Karl Heyes.

svn path=/trunk/icecast/; revision=4111
parent a6edc8f6
...@@ -4,13 +4,9 @@ BUGS ...@@ -4,13 +4,9 @@ BUGS
- autoconf doesn't set HAVE_POLL - autoconf doesn't set HAVE_POLL
- automake isn't installing things (conf, web) correctly.
- some stuff (like 'genre') isn't making it into the stats dump - some stuff (like 'genre') isn't making it into the stats dump
- thread_join uses thread->sys_thread, but thread structure has - make install - doesn't install configs?
already been freed in thread_exit()
FEATURES FEATURES
-------- --------
...@@ -32,3 +28,6 @@ FEATURES ...@@ -32,3 +28,6 @@ FEATURES
- allow using get_predata() stuff to send an "intro" to any newly-connected - allow using get_predata() stuff to send an "intro" to any newly-connected
user? user?
- stats to list currently connected clients: ip and hostname
...@@ -118,7 +118,7 @@ static connection_t *_accept_connection(void) ...@@ -118,7 +118,7 @@ static connection_t *_accept_connection(void)
connection_t *con; connection_t *con;
char *ip; char *ip;
if (util_timed_wait_for_fd(global.serversock, 30) <= 0) { if (util_timed_wait_for_fd(global.serversock, 100) <= 0) {
return NULL; return NULL;
} }
......
...@@ -235,8 +235,10 @@ static void *fserv_thread_function(void *arg) ...@@ -235,8 +235,10 @@ static void *fserv_thread_function(void *arg)
DEBUG0("Fileserving client had fatal error, disconnecting"); DEBUG0("Fileserving client had fatal error, disconnecting");
client->client->con->error = 1; client->client->con->error = 1;
} }
/*
else else
DEBUG0("Fileserving client had recoverable error"); DEBUG0("Fileserving client had recoverable error");
*/
avl_node_unlock(client_node); avl_node_unlock(client_node);
client_node = avl_get_next(client_node); client_node = avl_get_next(client_node);
......
...@@ -16,7 +16,7 @@ static mutex_t _global_mutex; ...@@ -16,7 +16,7 @@ static mutex_t _global_mutex;
void global_initialize(void) void global_initialize(void)
{ {
global.serversock = 0; global.serversock = -1;
global.running = 0; global.running = 0;
global.clients = 0; global.clients = 0;
global.sources = 0; global.sources = 0;
......
...@@ -34,7 +34,7 @@ void sighandler_initialize(void) ...@@ -34,7 +34,7 @@ void sighandler_initialize(void)
void _sig_hup(int signo) void _sig_hup(int signo)
{ {
INFO1("Caught signal %d, rehashing config and reopening logfiles...", signo); INFO1("Caught signal %d, rehashing config and reopening logfiles (unimplemented)...", signo);
/* reread config file */ /* reread config file */
......
...@@ -707,6 +707,9 @@ void thread_join(thread_t *thread) ...@@ -707,6 +707,9 @@ void thread_join(thread_t *thread)
int i; int i;
i = pthread_join(thread->sys_thread, &ret); i = pthread_join(thread->sys_thread, &ret);
_mutex_lock(&_threadtree_mutex);
avl_delete(_threadtree, thread, _free_thread);
_mutex_unlock(&_threadtree_mutex);
_free_thread(thread); _free_thread(thread);
} }
......
...@@ -54,15 +54,17 @@ int util_timed_wait_for_fd(int fd, int timeout) ...@@ -54,15 +54,17 @@ int util_timed_wait_for_fd(int fd, int timeout)
return poll(&ufds, 1, timeout); return poll(&ufds, 1, timeout);
#else #else
fd_set rfds; fd_set rfds;
struct timeval tv; struct timeval tv, *p=NULL;
FD_ZERO(&rfds); FD_ZERO(&rfds);
FD_SET(fd, &rfds); FD_SET(fd, &rfds);
tv.tv_sec = timeout/1000; if(timeout >= 0) {
tv.tv_usec = (timeout % 1000)*1000; tv.tv_sec = timeout/1000;
tv.tv_usec = (timeout % 1000)*1000;
return select(fd+1, &rfds, NULL, NULL, &tv); p = &tv;
}
return select(fd+1, &rfds, NULL, NULL, p);
#endif #endif
} }
......
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