Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xiph.Org
Icecast-Server
Commits
d0efb73a
Commit
d0efb73a
authored
Aug 08, 2018
by
Philipp Schafft
🦁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Feature: Also report loaded modules in report XML
parent
51712ebb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
1 deletion
+32
-1
src/admin.h
src/admin.h
+2
-0
src/client.c
src/client.c
+30
-1
No files found.
src/admin.h
View file @
d0efb73a
...
...
@@ -21,6 +21,8 @@
#include "compat.h"
#include "resourcematch.h"
#define ADMIN_ICESTATS_LEGACY_EXTENSION_APPLICATION "http://icecast.org/specs/legacy-icestats"
/* types */
#define ADMINTYPE_ERROR (-1)
#define ADMINTYPE_GENERAL 1
...
...
src/client.c
View file @
d0efb73a
...
...
@@ -24,6 +24,8 @@
#include <stdlib.h>
#include <string.h>
#include <libxml/tree.h>
#include "common/thread/thread.h"
#include "common/avl/avl.h"
#include "common/httpp/httpp.h"
...
...
@@ -51,7 +53,7 @@
#include "listensocket.h"
#include "fastevent.h"
/* for ADMIN_COMMAND_ERROR */
/* for ADMIN_COMMAND_ERROR
, and ADMIN_ICESTATS_LEGACY_EXTENSION_APPLICATION
*/
#include "admin.h"
#ifdef _WIN32
...
...
@@ -602,6 +604,31 @@ void client_send_reportxml(client_t *client, reportxml_t *report, document_domai
xmlFreeDoc
(
doc
);
}
static
void
client_get_reportxml__add_basic_stats
(
reportxml_t
*
report
)
{
reportxml_node_t
*
rootnode
,
*
extension
;
xmlNodePtr
xmlroot
;
xmlNodePtr
modules
;
rootnode
=
reportxml_get_root_node
(
report
);
extension
=
reportxml_node_new
(
REPORTXML_NODE_TYPE_EXTENSION
,
NULL
,
NULL
,
NULL
);
reportxml_node_set_attribute
(
extension
,
"application"
,
ADMIN_ICESTATS_LEGACY_EXTENSION_APPLICATION
);
reportxml_node_add_child
(
rootnode
,
extension
);
refobject_unref
(
rootnode
);
xmlroot
=
xmlNewNode
(
NULL
,
XMLSTR
(
"icestats"
));
modules
=
module_container_get_modulelist_as_xml
(
global
.
modulecontainer
);
xmlAddChild
(
xmlroot
,
modules
);
reportxml_node_add_xml_child
(
extension
,
xmlroot
);
refobject_unref
(
extension
);
xmlFreeNode
(
xmlroot
);
}
reportxml_t
*
client_get_reportxml
(
const
char
*
state_definition
,
const
char
*
state_akindof
,
const
char
*
state_text
)
{
reportxml_t
*
report
=
NULL
;
...
...
@@ -638,6 +665,8 @@ reportxml_t *client_get_reportxml(const char *state_definition, const char *stat
refobject_unref
(
rootnode
);
}
client_get_reportxml__add_basic_stats
(
report
);
return
report
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment