Feature: Added show-listeners parameter to stats.xml endpoint
This commit is contained in:
parent
6f2540426a
commit
75d7082e60
12
src/admin.c
12
src/admin.c
|
@ -1342,12 +1342,22 @@ static void command_shoutcast_metadata(client_t *client,
|
|||
|
||||
static void command_stats(client_t *client, source_t *source, admin_format_t response)
|
||||
{
|
||||
unsigned int flags = (source) ? STATS_XML_FLAG_SHOW_HIDDEN|STATS_XML_FLAG_SHOW_LISTENERS : STATS_XML_FLAG_SHOW_HIDDEN;
|
||||
unsigned int flags = STATS_XML_FLAG_SHOW_HIDDEN;
|
||||
const char *mount = (source) ? source->mount : NULL;
|
||||
xmlDocPtr doc;
|
||||
const char *show_listeners;
|
||||
|
||||
ICECAST_LOG_DEBUG("Stats request, sending xml stats");
|
||||
|
||||
COMMAND_OPTIONAL(client, "show-listeners", show_listeners);
|
||||
if (show_listeners) {
|
||||
if (util_str_to_bool(show_listeners))
|
||||
flags |= STATS_XML_FLAG_SHOW_LISTENERS;
|
||||
} else {
|
||||
if (source)
|
||||
flags |= STATS_XML_FLAG_SHOW_LISTENERS;
|
||||
}
|
||||
|
||||
doc = stats_get_xml(flags, mount, client);
|
||||
admin_send_response(doc, client, response, STATS_HTML_REQUEST);
|
||||
xmlFreeDoc(doc);
|
||||
|
|
Loading…
Reference in New Issue