[xiph-cvs] cvs commit: thread thread.c

Michael Smith msmith at xiph.org
Fri Nov 22 05:00:44 PST 2002



msmith      02/11/22 08:00:44

  Modified:    .        TODO
               src      connection.c fserve.c global.c sighandler.c util.c
               .        thread.c
  Log:
  Lots of bugfixes contributed by Karl Heyes.

Revision  Changes    Path
1.7       +4 -5      icecast/TODO

Index: TODO
===================================================================
RCS file: /usr/local/cvsroot/icecast/TODO,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- TODO	24 Sep 2002 08:16:22 -0000	1.6
+++ TODO	22 Nov 2002 13:00:44 -0000	1.7
@@ -4,13 +4,9 @@
 
 - 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
 --------
@@ -31,4 +27,7 @@
 
 - allow using get_predata() stuff to send an "intro" to any newly-connected
   user?
+
+- stats to list currently connected clients: ip and hostname
+
 

<p><p>1.30      +1 -1      icecast/src/connection.c

Index: connection.c
===================================================================
RCS file: /usr/local/cvsroot/icecast/src/connection.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- connection.c	10 Oct 2002 08:50:58 -0000	1.29
+++ connection.c	22 Nov 2002 13:00:44 -0000	1.30
@@ -118,7 +118,7 @@
         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;
         }
 

<p><p>1.6       +2 -0      icecast/src/fserve.c

Index: fserve.c
===================================================================
RCS file: /usr/local/cvsroot/icecast/src/fserve.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- fserve.c	28 Aug 2002 13:50:58 -0000	1.5
+++ fserve.c	22 Nov 2002 13:00:44 -0000	1.6
@@ -235,8 +235,10 @@
                 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);

<p><p>1.3       +1 -1      icecast/src/global.c

Index: global.c
===================================================================
RCS file: /usr/local/cvsroot/icecast/src/global.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- global.c	16 Aug 2002 14:26:48 -0000	1.2
+++ global.c	22 Nov 2002 13:00:44 -0000	1.3
@@ -16,7 +16,7 @@
 
 void global_initialize(void)
 {
-	global.serversock = 0;
+	global.serversock = -1;
         global.running = 0;
         global.clients = 0;
         global.sources = 0;

<p><p>1.2       +1 -1      icecast/src/sighandler.c

Index: sighandler.c
===================================================================
RCS file: /usr/local/cvsroot/icecast/src/sighandler.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sighandler.c	10 Sep 2001 02:21:49 -0000	1.1
+++ sighandler.c	22 Nov 2002 13:00:44 -0000	1.2
@@ -34,7 +34,7 @@
 
 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 */
 

<p><p>1.14      +7 -5      icecast/src/util.c

Index: util.c
===================================================================
RCS file: /usr/local/cvsroot/icecast/src/util.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- util.c	18 Aug 2002 08:49:25 -0000	1.13
+++ util.c	22 Nov 2002 13:00:44 -0000	1.14
@@ -54,15 +54,17 @@
     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
 }
 

<p><p>1.17      +3 -0      thread/thread.c

Index: thread.c
===================================================================
RCS file: /usr/local/cvsroot/thread/thread.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- thread.c	24 Sep 2002 07:09:08 -0000	1.16
+++ thread.c	22 Nov 2002 13:00:44 -0000	1.17
@@ -707,6 +707,9 @@
         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);
 }
 

<p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list