Commit c6a0b4cc authored by Karl Heyes's avatar Karl Heyes

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.


svn path=/icecast/trunk/icecast/; revision=15122
parent 26c9b65e
......@@ -367,6 +367,7 @@ static void *start_relay_stream (void *arg)
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 @@ static void check_relay_stream (relay_server *relay)
{
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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment