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) ...@@ -402,7 +402,20 @@ static void *start_relay_stream (void *arg)
ICECAST_LOG_INFO("Starting relayed source at mountpoint \"%s\"", relay->config->localmount); ICECAST_LOG_INFO("Starting relayed source at mountpoint \"%s\"", relay->config->localmount);
do do
{ {
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); client = open_relay_connection(relay, NULL);
}
if (client == NULL) if (client == NULL)
continue; 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