[xiph-commits] r7897 - icecast/branches/kh/icecast/src

karl at motherfish-iii.xiph.org karl at motherfish-iii.xiph.org
Thu Sep 30 16:28:20 PDT 2004


Author: karl
Date: 2004-09-30 16:28:20 -0700 (Thu, 30 Sep 2004)
New Revision: 7897

Modified:
   icecast/branches/kh/icecast/src/fserve.c
Log:
shuffled code around slightly, older compilers may have trouble building it


Modified: icecast/branches/kh/icecast/src/fserve.c
===================================================================
--- icecast/branches/kh/icecast/src/fserve.c	2004-09-30 13:57:44 UTC (rev 7896)
+++ icecast/branches/kh/icecast/src/fserve.c	2004-09-30 23:28:20 UTC (rev 7897)
@@ -130,24 +130,6 @@
     fserve_t *fclient;
 
     while(run_fserv) {
-        if (pending_list)
-        {
-            thread_mutex_lock (&pending_lock);
-
-            fclient = (fserve_t*)pending_list;
-            while (fclient)
-            {
-                fserve_t *to_move = fclient;
-                fclient = fclient->next;
-                to_move->next = active_list;
-                active_list = to_move;
-                client_tree_changed = 1;
-                fserve_clients++;
-                stats_event_inc(NULL, "clients");
-            }
-            pending_list = NULL;
-            thread_mutex_unlock (&pending_lock);
-        }
 #ifdef HAVE_POLL
         unsigned int i = 0;
 
@@ -173,7 +155,6 @@
                     fclient->ready = 1;
                 fclient = fclient->next;
             }
-            return;
         }
 #else
         struct timeval tv;
@@ -203,9 +184,27 @@
                     fclient->ready = 1;
                 fclient = fclient->next;
             }
-            return;
         }
 #endif
+        /* add any new clients here */
+        if (pending_list)
+        {
+            thread_mutex_lock (&pending_lock);
+
+            fclient = (fserve_t*)pending_list;
+            while (fclient)
+            {
+                fserve_t *to_move = fclient;
+                fclient = fclient->next;
+                to_move->next = active_list;
+                active_list = to_move;
+                client_tree_changed = 1;
+                fserve_clients++;
+                stats_event_inc(NULL, "clients");
+            }
+            pending_list = NULL;
+            thread_mutex_unlock (&pending_lock);
+        }
     }
 }
 



More information about the commits mailing list