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

karl at svn.xiph.org karl at svn.xiph.org
Mon Sep 3 15:04:04 PDT 2007


Author: karl
Date: 2007-09-03 15:04:04 -0700 (Mon, 03 Sep 2007)
New Revision: 13709

Modified:
   icecast/trunk/icecast/src/admin.c
Log:
fix for #734. Allow /admin/stats[.xsl] to take an optional mount arg which only
returns global stats and stats for that particular mountpoint.



Modified: icecast/trunk/icecast/src/admin.c
===================================================================
--- icecast/trunk/icecast/src/admin.c	2007-09-03 18:52:19 UTC (rev 13708)
+++ icecast/trunk/icecast/src/admin.c	2007-09-03 22:04:04 UTC (rev 13709)
@@ -177,7 +177,7 @@
         int response);
 static void command_move_clients(client_t *client, source_t *source,
         int response);
-static void command_stats(client_t *client, int response);
+static void command_stats(client_t *client, const char *mount, int response);
 static void command_list_mounts(client_t *client, int response);
 static void command_kill_client(client_t *client, source_t *source,
         int response);
@@ -435,7 +435,7 @@
 {
     switch(command) {
         case COMMAND_RAW_STATS:
-            command_stats(client, RAW);
+            command_stats(client, NULL, RAW);
             break;
         case COMMAND_RAW_LIST_MOUNTS:
             command_list_mounts(client, RAW);
@@ -447,7 +447,7 @@
             command_list_mounts(client, PLAINTEXT);
             break;
         case COMMAND_TRANSFORMED_STATS:
-            command_stats(client, TRANSFORMED);
+            command_stats(client, NULL, TRANSFORMED);
             break;
         case COMMAND_TRANSFORMED_LIST_MOUNTS:
             command_list_mounts(client, TRANSFORMED);
@@ -469,6 +469,9 @@
         int command)
 {
     switch(command) {
+        case COMMAND_RAW_STATS:
+            command_stats(client, source->mount, RAW);
+            break;
         case COMMAND_RAW_FALLBACK:
             command_fallback(client, source, RAW);
             break;
@@ -493,6 +496,9 @@
         case COMMAND_RAW_KILL_SOURCE:
             command_kill_source(client, source, RAW);
             break;
+        case COMMAND_TRANSFORMED_STATS:
+            command_stats(client, source->mount, TRANSFORMED);
+            break;
         case COMMAND_TRANSFORMED_FALLBACK:
             command_fallback(client, source, RAW);
             break;
@@ -949,12 +955,12 @@
     }
 }
 
-static void command_stats(client_t *client, int response) {
+static void command_stats(client_t *client, const char *mount, int response) {
     xmlDocPtr doc;
 
     DEBUG0("Stats request, sending xml stats");
 
-    stats_get_xml(&doc, 1, NULL);
+    stats_get_xml(&doc, 1, mount);
     admin_send_response(doc, client, response, STATS_TRANSFORMED_REQUEST);
     xmlFreeDoc(doc);
     return;



More information about the commits mailing list