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

Michael Smith msmith at xiph.org
Mon Dec 30 07:42:39 PST 2002



msmith      02/12/30 10:42:39

  Modified:    src      connection.c slave.c
  Log:
  Better file-serving, rationalisation of some paths

Revision  Changes    Path
1.36      +21 -1     icecast/src/connection.c

Index: connection.c
===================================================================
RCS file: /usr/local/cvsroot/icecast/src/connection.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- connection.c	30 Dec 2002 07:55:56 -0000	1.35
+++ connection.c	30 Dec 2002 15:42:38 -0000	1.36
@@ -561,6 +561,26 @@
             if(bytes > 0) client->con->sent_bytes = bytes;
                 client_destroy(client);
         }
+        else if(config_get_config()->fileserve) {
+            fullpath = util_get_path_from_normalised_uri(sourceuri);
+            if(stat(fullpath, &statbuf) == 0) {
+                fserve_client_create(client, fullpath);
+                free(fullpath);
+            }
+            else {
+                free(fullpath);
+                fullpath = util_get_path_from_normalised_uri(uri);
+                if(stat(fullpath, &statbuf) == 0) {
+                    fserve_client_create(client, fullpath);
+                    free(fullpath);
+                }
+                else {
+                    free(fullpath);
+                    client_send_404(client, 
+                            "The file you requested could not be found");
+                }
+            }
+        }
         else {
             client_send_404(client, "The file you requested could not be found");
         }
@@ -569,7 +589,7 @@
         return;
     }
 
-	if (strcmp(uri, "/allstreams.txt") == 0) {
+	if (strcmp(uri, "/admin/streamlist") == 0) {
                 if (!_check_relay_pass(parser)) {
                         INFO0("Client attempted to fetch allstreams.txt with bad password");
             client_send_401(client);

<p><p>1.11      +4 -1      icecast/src/slave.c

Index: slave.c
===================================================================
RCS file: /usr/local/cvsroot/icecast/src/slave.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- slave.c	30 Dec 2002 07:55:56 -0000	1.10
+++ slave.c	30 Dec 2002 15:42:38 -0000	1.11
@@ -100,7 +100,10 @@
         strcat(authheader, ":");
         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);
+		sock_write(mastersock, 
+                "GET /admin/streamlist HTTP/1.0\r\n"
+                "Authorization: Basic %s\r\n"
+                "\r\n", data);
         free(authheader);
         free(data);
                 while (sock_read_line(mastersock, buf, sizeof(buf))) {

<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