[xiph-cvs] cvs commit: icecast/src slave.c

Michael Smith msmith at xiph.org
Fri Aug 16 23:25:38 PDT 2002



msmith      02/08/17 02:25:38

  Modified:    src      slave.c
  Log:
  Fall back to using the source-password if no master-password is set.

Revision  Changes    Path
1.6       +7 -2      icecast/src/slave.c

Index: slave.c
===================================================================
RCS file: /usr/local/cvsroot/icecast/src/slave.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- slave.c	16 Aug 2002 14:55:56 -0000	1.5
+++ slave.c	17 Aug 2002 06:25:38 -0000	1.6
@@ -75,6 +75,11 @@
     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 @@
                         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);

<p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list