Commit 4b2a062a authored by Philipp Schafft's avatar Philipp Schafft 🦁

Feature: Allow actually using more than one upstream

parent bde17102
......@@ -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;
......
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