mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2024-12-04 14:46:30 -05:00
Update: Convert stats_get_xml() to take flags
This commit is contained in:
parent
1a5359025c
commit
5eb09ca5de
@ -1191,7 +1191,7 @@ static void command_stats(client_t *client, source_t *source, admin_format_t res
|
|||||||
|
|
||||||
ICECAST_LOG_DEBUG("Stats request, sending xml stats");
|
ICECAST_LOG_DEBUG("Stats request, sending xml stats");
|
||||||
|
|
||||||
doc = stats_get_xml(1, mount, client);
|
doc = stats_get_xml(STATS_XML_FLAG_SHOW_HIDDEN, mount, client);
|
||||||
admin_send_response(doc, client, response, STATS_HTML_REQUEST);
|
admin_send_response(doc, client, response, STATS_HTML_REQUEST);
|
||||||
xmlFreeDoc(doc);
|
xmlFreeDoc(doc);
|
||||||
return;
|
return;
|
||||||
|
@ -480,7 +480,7 @@ int fserve_client_create (client_t *httpclient)
|
|||||||
char *eol = strrchr (reference, '.');
|
char *eol = strrchr (reference, '.');
|
||||||
if (eol)
|
if (eol)
|
||||||
*eol = '\0';
|
*eol = '\0';
|
||||||
doc = stats_get_xml (0, reference, httpclient);
|
doc = stats_get_xml(STATS_XML_FLAG_NONE, reference, httpclient);
|
||||||
free (reference);
|
free (reference);
|
||||||
admin_send_response (doc, httpclient, ADMIN_FORMAT_HTML, xslt_playlist_requested);
|
admin_send_response (doc, httpclient, ADMIN_FORMAT_HTML, xslt_playlist_requested);
|
||||||
xmlFreeDoc(doc);
|
xmlFreeDoc(doc);
|
||||||
|
@ -1051,7 +1051,7 @@ void stats_transform_xslt(client_t *client)
|
|||||||
char *xslpath = util_get_path_from_normalised_uri(client->uri);
|
char *xslpath = util_get_path_from_normalised_uri(client->uri);
|
||||||
const char *mount = httpp_get_param(client->parser, "mount");
|
const char *mount = httpp_get_param(client->parser, "mount");
|
||||||
|
|
||||||
doc = stats_get_xml(0, mount, client);
|
doc = stats_get_xml(STATS_XML_FLAG_NONE, mount, client);
|
||||||
|
|
||||||
xslt_transform(doc, xslpath, client, 200, NULL, NULL);
|
xslt_transform(doc, xslpath, client, 200, NULL, NULL);
|
||||||
|
|
||||||
@ -1082,7 +1082,7 @@ static void __add_metadata(xmlNodePtr node, const char *tag) {
|
|||||||
free(name);
|
free(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
xmlDocPtr stats_get_xml(int show_hidden, const char *show_mount, client_t *client)
|
xmlDocPtr stats_get_xml(unsigned int flags, const char *show_mount, client_t *client)
|
||||||
{
|
{
|
||||||
xmlDocPtr doc;
|
xmlDocPtr doc;
|
||||||
xmlNodePtr node;
|
xmlNodePtr node;
|
||||||
@ -1096,7 +1096,7 @@ xmlDocPtr stats_get_xml(int show_hidden, const char *show_mount, client_t *clien
|
|||||||
modules = module_container_get_modulelist_as_xml(global.modulecontainer);
|
modules = module_container_get_modulelist_as_xml(global.modulecontainer);
|
||||||
xmlAddChild(node, modules);
|
xmlAddChild(node, modules);
|
||||||
|
|
||||||
node = _dump_stats_to_doc(node, show_mount, show_hidden, client);
|
node = _dump_stats_to_doc(node, show_mount, flags & STATS_XML_FLAG_SHOW_HIDDEN ? 1 : 0, client);
|
||||||
|
|
||||||
if (show_mount && node) {
|
if (show_mount && node) {
|
||||||
avl_tree_rlock(global.source_tree);
|
avl_tree_rlock(global.source_tree);
|
||||||
|
@ -21,6 +21,9 @@
|
|||||||
#include "icecasttypes.h"
|
#include "icecasttypes.h"
|
||||||
#include "refbuf.h"
|
#include "refbuf.h"
|
||||||
|
|
||||||
|
#define STATS_XML_FLAG_NONE 0x0000U
|
||||||
|
#define STATS_XML_FLAG_SHOW_HIDDEN 0x0001U
|
||||||
|
|
||||||
typedef struct _stats_node_tag
|
typedef struct _stats_node_tag
|
||||||
{
|
{
|
||||||
char *name;
|
char *name;
|
||||||
@ -95,7 +98,7 @@ void stats_callback (client_t *client, void *notused);
|
|||||||
|
|
||||||
void stats_transform_xslt(client_t *client);
|
void stats_transform_xslt(client_t *client);
|
||||||
void stats_sendxml(client_t *client);
|
void stats_sendxml(client_t *client);
|
||||||
xmlDocPtr stats_get_xml(int show_hidden, const char *show_mount, client_t *client);
|
xmlDocPtr stats_get_xml(unsigned int flags, const char *show_mount, client_t *client);
|
||||||
char *stats_get_value(const char *source, const char *name);
|
char *stats_get_value(const char *source, const char *name);
|
||||||
|
|
||||||
#endif /* __STATS_H__ */
|
#endif /* __STATS_H__ */
|
||||||
|
Loading…
Reference in New Issue
Block a user