[xiph-commits] r9213 - icecast/trunk/icecast/src

karl at motherfish-iii.xiph.org karl at motherfish-iii.xiph.org
Thu May 5 13:05:18 PDT 2005


Author: karl
Date: 2005-05-05 13:05:15 -0700 (Thu, 05 May 2005)
New Revision: 9213

Modified:
   icecast/trunk/icecast/src/admin.c
Log:
from branch. make streamlist.txt from the mount list, so that fallback handling
can be taken into account. If we just use the source tree then entries can
disappear causing a relay to shutdown in the slave.


Modified: icecast/trunk/icecast/src/admin.c
===================================================================
--- icecast/trunk/icecast/src/admin.c	2005-05-05 05:23:52 UTC (rev 9212)
+++ icecast/trunk/icecast/src/admin.c	2005-05-05 20:05:15 UTC (rev 9213)
@@ -973,18 +973,30 @@
         int ret = snprintf (buffer, remaining,
                 "HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n");
 
-        avl_node *node = avl_get_first(global.source_tree);
-        while (node && ret > 0 && (unsigned)ret < remaining)
+        ice_config_t *config = config_get_config ();
+        mount_proxy *mountinfo = config->mounts;
+        while (mountinfo)
         {
-            source_t *source = (source_t *)node->key;
-            node = avl_get_next(node);
-            if (source->hidden || source->running == 0)
+            mount_proxy *current = mountinfo;
+            source_t *source;
+            mountinfo = mountinfo->next;
+
+            /* now check that a source is available */
+            source = source_find_mount (current->mountname);
+
+            if (source == NULL)
                 continue;
+            if (source->running == 0)
+                continue;
+            if (source->hidden)
+                continue;
             remaining -= ret;
             buf += ret;
-            ret = snprintf (buf, remaining, "%s\n", source->mount);
+            ret = snprintf (buf, remaining, "%s\n", current->mountname);
         }
         avl_tree_unlock (global.source_tree);
+        config_release_config();
+
         /* handle last line */
         if (ret > 0 && (unsigned)ret < remaining)
         {



More information about the commits mailing list