diff --git a/TODO b/TODO index 633be566..0ab9cfaa 100644 --- a/TODO +++ b/TODO @@ -4,13 +4,9 @@ BUGS - 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 -- thread_join uses thread->sys_thread, but thread structure has - already been freed in thread_exit() - +- make install - doesn't install configs? FEATURES -------- @@ -32,3 +28,6 @@ FEATURES - allow using get_predata() stuff to send an "intro" to any newly-connected user? +- stats to list currently connected clients: ip and hostname + + diff --git a/src/connection.c b/src/connection.c index c0fdec8e..f56782e1 100644 --- a/src/connection.c +++ b/src/connection.c @@ -118,7 +118,7 @@ static connection_t *_accept_connection(void) connection_t *con; char *ip; - if (util_timed_wait_for_fd(global.serversock, 30) <= 0) { + if (util_timed_wait_for_fd(global.serversock, 100) <= 0) { return NULL; } diff --git a/src/fserve.c b/src/fserve.c index de9980d3..0da215c5 100644 --- a/src/fserve.c +++ b/src/fserve.c @@ -235,8 +235,10 @@ static void *fserv_thread_function(void *arg) DEBUG0("Fileserving client had fatal error, disconnecting"); client->client->con->error = 1; } + /* else DEBUG0("Fileserving client had recoverable error"); + */ avl_node_unlock(client_node); client_node = avl_get_next(client_node); diff --git a/src/global.c b/src/global.c index 284610ff..faac17b5 100644 --- a/src/global.c +++ b/src/global.c @@ -16,7 +16,7 @@ static mutex_t _global_mutex; void global_initialize(void) { - global.serversock = 0; + global.serversock = -1; global.running = 0; global.clients = 0; global.sources = 0; diff --git a/src/sighandler.c b/src/sighandler.c index 56b28416..984beb0e 100644 --- a/src/sighandler.c +++ b/src/sighandler.c @@ -34,7 +34,7 @@ void sighandler_initialize(void) 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 */ diff --git a/src/thread/thread.c b/src/thread/thread.c index b9ba02b0..ea0eb9bc 100644 --- a/src/thread/thread.c +++ b/src/thread/thread.c @@ -707,6 +707,9 @@ void thread_join(thread_t *thread) int i; i = pthread_join(thread->sys_thread, &ret); + _mutex_lock(&_threadtree_mutex); + avl_delete(_threadtree, thread, _free_thread); + _mutex_unlock(&_threadtree_mutex); _free_thread(thread); } diff --git a/src/util.c b/src/util.c index b4792483..7e165096 100644 --- a/src/util.c +++ b/src/util.c @@ -54,15 +54,17 @@ int util_timed_wait_for_fd(int fd, int timeout) return poll(&ufds, 1, timeout); #else fd_set rfds; - struct timeval tv; + struct timeval tv, *p=NULL; FD_ZERO(&rfds); FD_SET(fd, &rfds); - tv.tv_sec = timeout/1000; - tv.tv_usec = (timeout % 1000)*1000; - - return select(fd+1, &rfds, NULL, NULL, &tv); + if(timeout >= 0) { + tv.tv_sec = timeout/1000; + tv.tv_usec = (timeout % 1000)*1000; + p = &tv; + } + return select(fd+1, &rfds, NULL, NULL, p); #endif }