[xiph-commits] r13908 - icecast/trunk/icecast/src

karl at svn.xiph.org karl at svn.xiph.org
Thu Sep 27 17:54:02 PDT 2007


Author: karl
Date: 2007-09-27 17:54:01 -0700 (Thu, 27 Sep 2007)
New Revision: 13908

Modified:
   icecast/trunk/icecast/src/admin.c
Log:
Allow buildm3u to work with the mount given, no need to check the source tree. closes #866


Modified: icecast/trunk/icecast/src/admin.c
===================================================================
--- icecast/trunk/icecast/src/admin.c	2007-09-24 23:13:44 UTC (rev 13907)
+++ icecast/trunk/icecast/src/admin.c	2007-09-28 00:54:01 UTC (rev 13908)
@@ -183,8 +183,7 @@
         int response);
 static void command_manageauth(client_t *client, source_t *source,
         int response);
-static void command_buildm3u(client_t *client, source_t *source,
-        int response);
+static void command_buildm3u(client_t *client, const char *mount);
 static void command_kill_source(client_t *client, source_t *source,
         int response);
 static void command_updatemetadata(client_t *client, source_t *source,
@@ -307,7 +306,6 @@
 {
     const char *mount, *command_string;
     int command;
-    int noauth = 0;
 
     DEBUG1("Admin request (%s)", uri);
     if (!((strcmp(uri, "/admin.cgi") == 0) ||
@@ -355,18 +353,21 @@
     if(mount != NULL) {
         source_t *source;
 
-        if (command == COMMAND_BUILDM3U) {
-            noauth = 1;
+        /* this request does not require auth but can apply to files on webroot */
+        if (command == COMMAND_BUILDM3U)
+        {
+            command_buildm3u (client, mount);
+            return;
         }
         /* This is a mount request, handle it as such */
-        if (!noauth) {
-            if(!connection_check_admin_pass(client->parser)) {
-                if(!connection_check_source_pass(client->parser, mount)) {
-                    INFO1("Bad or missing password on mount modification admin "
-                          "request (command: %s)", command_string);
-                    client_send_401(client);
-                    return;
-                }
+        if (!connection_check_admin_pass(client->parser))
+        {
+            if (!connection_check_source_pass(client->parser, mount))
+            {
+                INFO1("Bad or missing password on mount modification admin "
+                        "request (command: %s)", command_string);
+                client_send_401(client);
+                return;
             }
         }
         
@@ -526,9 +527,6 @@
         case COMMAND_RAW_UPDATEMETADATA:
             command_updatemetadata(client, source, RAW);
             break;
-        case COMMAND_BUILDM3U:
-            command_buildm3u(client, source, RAW);
-            break;
         default:
             WARN0("Mount request not recognised");
             client_send_400(client, "Mount request unknown");
@@ -674,8 +672,7 @@
     xmlFreeDoc(doc);
 }
 
-static void command_buildm3u(client_t *client, source_t *source,
-    int response)
+static void command_buildm3u(client_t *client,  const char *mount)
 {
     const char *username = NULL;
     const char *password = NULL;
@@ -695,7 +692,7 @@
         password,
         config->hostname,
         config->port,
-        source->mount
+        mount
     );
     config_release_config();
 



More information about the commits mailing list