[xiph-commits] r17365 - icecast/branches/kh/icecast/src

karl at svn.xiph.org karl at svn.xiph.org
Tue Aug 17 07:56:52 PDT 2010


Author: karl
Date: 2010-08-17 07:56:52 -0700 (Tue, 17 Aug 2010)
New Revision: 17365

Modified:
   icecast/branches/kh/icecast/src/admin.c
   icecast/branches/kh/icecast/src/auth.c
   icecast/branches/kh/icecast/src/connection.c
Log:
do a proper fix for the auth on /admin/streams and make sure the stats
connection works with the recent worker changes


Modified: icecast/branches/kh/icecast/src/admin.c
===================================================================
--- icecast/branches/kh/icecast/src/admin.c	2010-08-17 00:26:27 UTC (rev 17364)
+++ icecast/branches/kh/icecast/src/admin.c	2010-08-17 14:56:52 UTC (rev 17365)
@@ -91,6 +91,7 @@
     { "listmounts",         RAW,    { command_list_mounts } },
     { "function",           RAW,    { command_admin_function } },
     { "streamlist.txt",     TEXT,   { command_list_mounts } },
+    { "streams",            TEXT,   { command_list_mounts } },
     { "showlog.txt",        TEXT,   { command_list_log } },
     { "showlog.xsl",        XSLT,   { command_list_log } },
     { "managerelays.xsl",   XSLT,   { command_manage_relay } },
@@ -354,14 +355,8 @@
         client->flags |= CLIENT_AUTHENTICATED;
 
     /* special case for slaves requesting a streamlist for authenticated relaying */
-    if (strcmp (uri, "streams") == 0)
+    if (strcmp (uri, "streams") == 0 || strcmp (uri, "streamlist.txt") == 0)
     {
-        client->flags |= CLIENT_IS_SLAVE;
-        auth_add_listener ("/admin/streams", client);
-        return 0;
-    }
-    if (strcmp (uri, "streamlist.txt") == 0)
-    {
         if (connection_check_relay_pass (client->parser))
             client->flags |= CLIENT_AUTHENTICATED;
     }
@@ -396,7 +391,10 @@
                     return 0;
             }
         }
-        admin_mount_request (client, uri);
+        if (strcmp (uri, "streams") == 0)
+            auth_add_listener ("/admin/streams", client);
+        else
+            admin_mount_request (client, uri);
         return 0;
     }
 

Modified: icecast/branches/kh/icecast/src/auth.c
===================================================================
--- icecast/branches/kh/icecast/src/auth.c	2010-08-17 00:26:27 UTC (rev 17364)
+++ icecast/branches/kh/icecast/src/auth.c	2010-08-17 14:56:52 UTC (rev 17365)
@@ -571,10 +571,7 @@
     }
     else
     {
-        if (client->flags & CLIENT_AUTHENTICATED)
-            add_authenticated_listener (mount, mountinfo, client);
-        else
-            client_send_403 (client, "Forbidden");
+        add_authenticated_listener (mount, mountinfo, client);
     }
     config_release_config ();
 }

Modified: icecast/branches/kh/icecast/src/connection.c
===================================================================
--- icecast/branches/kh/icecast/src/connection.c	2010-08-17 00:26:27 UTC (rev 17364)
+++ icecast/branches/kh/icecast/src/connection.c	2010-08-17 14:56:52 UTC (rev 17365)
@@ -1248,7 +1248,7 @@
         return 0;
     }
     stats_add_listener (client, STATS_ALL);
-    return 1;
+    return 0;
 }
 
 static void check_for_filtering (ice_config_t *config, client_t *client, char *uri)



More information about the commits mailing list