From 14b28dd860abc8783386183a51625796cab02cae Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Sat, 17 Aug 2002 06:25:38 +0000 Subject: [PATCH] Fall back to using the source-password if no master-password is set. svn path=/trunk/icecast/; revision=3849 --- src/slave.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/slave.c b/src/slave.c index 9902c880..89475bde 100644 --- a/src/slave.c +++ b/src/slave.c @@ -75,6 +75,11 @@ static void *_slave_thread(void *arg) { char *authheader, *data; int len; char *username = "relay"; + char *password = config_get_config()->master_password; + + if(password == NULL) + password = config_get_config()->source_password; + while (_initialized) { if (config_get_config()->master_update_interval > ++interval) { @@ -90,11 +95,11 @@ static void *_slave_thread(void *arg) { continue; } - len = strlen(username) + strlen(config_get_config()->master_password) + 1; + len = strlen(username) + strlen(password) + 1; authheader = malloc(len+1); strcpy(authheader, username); strcat(authheader, ":"); - strcat(authheader, config_get_config()->master_password); + strcat(authheader, password); data = util_base64_encode(authheader); sock_write(mastersock, "GET /allstreams.txt HTTP/1.0\r\nAuthorization: Basic %s\r\n\r\n", data); free(data);