mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2025-01-03 14:56:34 -05:00
fix for #734. Allow /admin/stats[.xsl] to take an optional mount arg which only
returns global stats and stats for that particular mountpoint. svn path=/icecast/trunk/icecast/; revision=13709
This commit is contained in:
parent
d327fc8914
commit
2c67cfffb2
16
src/admin.c
16
src/admin.c
@ -177,7 +177,7 @@ static void command_show_listeners(client_t *client, source_t *source,
|
||||
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 @@ static void admin_handle_general_request(client_t *client, int command)
|
||||
{
|
||||
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 @@ static void admin_handle_general_request(client_t *client, int command)
|
||||
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 @@ static void admin_handle_mount_request(client_t *client, source_t *source,
|
||||
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 @@ static void admin_handle_mount_request(client_t *client, source_t *source,
|
||||
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_shoutcast_metadata(client_t *client, source_t *source)
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user