mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2024-09-29 04:25:55 -04:00
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
This commit is contained in:
parent
26c9b65eb0
commit
c6a0b4cc8b
@ -367,6 +367,7 @@ static void *start_relay_stream (void *arg)
|
|||||||
source_clear_source (relay->source);
|
source_clear_source (relay->source);
|
||||||
|
|
||||||
/* cleanup relay, but prevent this relay from starting up again too soon */
|
/* cleanup relay, but prevent this relay from starting up again too soon */
|
||||||
|
relay->source->on_demand = 0;
|
||||||
relay->start = time(NULL) + max_interval;
|
relay->start = time(NULL) + max_interval;
|
||||||
relay->cleanup = 1;
|
relay->cleanup = 1;
|
||||||
|
|
||||||
@ -391,8 +392,16 @@ static void check_relay_stream (relay_server *relay)
|
|||||||
{
|
{
|
||||||
DEBUG1("Adding relay source at mountpoint \"%s\"", relay->localmount);
|
DEBUG1("Adding relay source at mountpoint \"%s\"", relay->localmount);
|
||||||
if (relay->on_demand)
|
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();
|
slave_update_all_mounts();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
WARN1 ("new relay but source \"%s\" already exists", relay->localmount);
|
WARN1 ("new relay but source \"%s\" already exists", relay->localmount);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user