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

Fall back to using the source-password if no master-password is set.

svn path=/trunk/icecast/; revision=3849
This commit is contained in:
Michael Smith 2002-08-17 06:25:38 +00:00
parent d54dccb8ad
commit 14b28dd860

View File

@ -75,6 +75,11 @@ static void *_slave_thread(void *arg) {
char *authheader, *data; char *authheader, *data;
int len; int len;
char *username = "relay"; char *username = "relay";
char *password = config_get_config()->master_password;
if(password == NULL)
password = config_get_config()->source_password;
while (_initialized) { while (_initialized) {
if (config_get_config()->master_update_interval > ++interval) { if (config_get_config()->master_update_interval > ++interval) {
@ -90,11 +95,11 @@ static void *_slave_thread(void *arg) {
continue; continue;
} }
len = strlen(username) + strlen(config_get_config()->master_password) + 1; len = strlen(username) + strlen(password) + 1;
authheader = malloc(len+1); authheader = malloc(len+1);
strcpy(authheader, username); strcpy(authheader, username);
strcat(authheader, ":"); strcat(authheader, ":");
strcat(authheader, config_get_config()->master_password); strcat(authheader, password);
data = util_base64_encode(authheader); data = util_base64_encode(authheader);
sock_write(mastersock, "GET /allstreams.txt HTTP/1.0\r\nAuthorization: Basic %s\r\n\r\n", data); sock_write(mastersock, "GET /allstreams.txt HTTP/1.0\r\nAuthorization: Basic %s\r\n\r\n", data);
free(data); free(data);