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

karl at svn.xiph.org karl at svn.xiph.org
Fri Jul 18 18:57:54 PDT 2008


Author: karl
Date: 2008-07-18 18:57:53 -0700 (Fri, 18 Jul 2008)
New Revision: 15122

Modified:
   icecast/trunk/icecast/src/slave.c
Log:
2 on-demand relay fixups.

We prevent a failed relay from restarting too quickly but don't prevent
connecting listeners from getting to the source_t during that time. Drop the
on-demand status in the source_t during this period so listeners are rejected.
The setting is reset from relay eventually.

Relays without matching mount sections had no stats initially.



Modified: icecast/trunk/icecast/src/slave.c
===================================================================
--- icecast/trunk/icecast/src/slave.c	2008-07-19 01:36:16 UTC (rev 15121)
+++ icecast/trunk/icecast/src/slave.c	2008-07-19 01:57:53 UTC (rev 15122)
@@ -367,6 +367,7 @@
     source_clear_source (relay->source);
 
     /* cleanup relay, but prevent this relay from starting up again too soon */
+    relay->source->on_demand = 0;
     relay->start = time(NULL) + max_interval;
     relay->cleanup = 1;
 
@@ -391,7 +392,15 @@
         {
             DEBUG1("Adding relay source at mountpoint \"%s\"", relay->localmount);
             if (relay->on_demand)
+            {
+                ice_config_t *config = config_get_config ();
+                mount_proxy *mountinfo = config_find_mount (config, relay->localmount);
+                if (mountinfo == NULL)
+                    source_update_settings (config, relay->source, mountinfo);
+                config_release_config ();
+                stats_event (relay->localmount, "listeners", "0");
                 slave_update_all_mounts();
+            }
         }
         else
             WARN1 ("new relay but source \"%s\" already exists", relay->localmount);



More information about the commits mailing list