1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-12-04 14:46:30 -05:00

Fix relaying. Oops.

svn path=/trunk/icecast/; revision=4328
This commit is contained in:
Michael Smith 2003-02-07 11:46:03 +00:00
parent e3bb942ed9
commit 8600634e68

View File

@ -51,7 +51,8 @@ static int _initialized = 0;
void slave_initialize(void) { void slave_initialize(void) {
if (_initialized) return; if (_initialized) return;
/* Don't create a slave thread if it isn't configured */ /* Don't create a slave thread if it isn't configured */
if (config_get_config()->master_server == NULL) if (config_get_config()->master_server == NULL &&
config_get_config()->relay == NULL)
return; return;
_initialized = 1; _initialized = 1;
@ -129,7 +130,9 @@ static void *_slave_thread(void *arg) {
else else
interval = 0; interval = 0;
mastersock = sock_connect_wto(config_get_config()->master_server, config_get_config()->master_server_port, 0); if(config_get_config()->master_server != NULL) {
mastersock = sock_connect_wto(config_get_config()->master_server,
config_get_config()->master_server_port, 0);
if (mastersock == SOCK_ERROR) { if (mastersock == SOCK_ERROR) {
WARN0("Relay slave failed to contact master server to fetch stream list"); WARN0("Relay slave failed to contact master server to fetch stream list");
continue; continue;
@ -166,6 +169,7 @@ static void *_slave_thread(void *arg) {
avl_tree_unlock(global.source_tree); avl_tree_unlock(global.source_tree);
} }
sock_close(mastersock); sock_close(mastersock);
}
/* And now, we process the individual mounts... */ /* And now, we process the individual mounts... */
relay_server *relay = config_get_config()->relay; relay_server *relay = config_get_config()->relay;
@ -178,6 +182,7 @@ static void *_slave_thread(void *arg) {
} }
else else
avl_tree_unlock(global.source_tree); avl_tree_unlock(global.source_tree);
relay = relay->next;
} }
} }
thread_exit(0); thread_exit(0);