1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-09-22 04:15:54 -04:00

Feature: Allow actually using more than one upstream

This commit is contained in:
Philipp Schafft 2018-07-26 08:18:54 +00:00
parent bde17102e2
commit 4b2a062aa0

View File

@ -402,7 +402,20 @@ static void *start_relay_stream (void *arg)
ICECAST_LOG_INFO("Starting relayed source at mountpoint \"%s\"", relay->config->localmount);
do
{
client = open_relay_connection(relay, NULL);
size_t i;
for (i = 0; i < relay->config->upstreams; i++) {
ICECAST_LOG_DEBUG("For relay on mount \"%s\", trying upstream #%zu", relay->config->localmount, i);
client = open_relay_connection(relay, &(relay->config->upstream[i]));
if (client)
break;
}
/* if we have no upstreams defined, use the default upstream */
if (!relay->config->upstreams) {
ICECAST_LOG_DEBUG("For relay on mount \"%s\" with no upstreams trying upstream default", relay->config->localmount);
client = open_relay_connection(relay, NULL);
}
if (client == NULL)
continue;