1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-09-29 04:25:55 -04:00

Update: Only look up first child if we really need to.

This commit is contained in:
Philipp Schafft 2018-06-08 09:46:17 +00:00
parent a014f1c5cc
commit 6f8270dcfb

View File

@ -994,7 +994,7 @@ reportxml_t * reportxml_database_build_report(reportxml_database_t *db
return NULL; return NULL;
/* first find the definition itself. This will be some REPORTXML_NODE_TYPE_DEFINITION node. */ /* first find the definition itself. This will be some REPORTXML_NODE_TYPE_DEFINITION node. */
definition = reportxml_database_build_node(db, id, depth); definition = __reportxml_database_build_node_ext(db, id, depth, &type);
if (!definition) { if (!definition) {
ICECAST_LOG_WARN("No matching definition for \"%H\"", id); ICECAST_LOG_WARN("No matching definition for \"%H\"", id);
return NULL; return NULL;
@ -1013,6 +1013,7 @@ reportxml_t * reportxml_database_build_report(reportxml_database_t *db
return reportxml_new(); return reportxml_new();
} }
if (type != REPORTXML_NODE_TYPE__ERROR) {
/* Now the hard part: find out what level we are. */ /* Now the hard part: find out what level we are. */
child = reportxml_node_get_child(definition, 0); child = reportxml_node_get_child(definition, 0);
if (!child) { if (!child) {
@ -1023,6 +1024,7 @@ reportxml_t * reportxml_database_build_report(reportxml_database_t *db
type = reportxml_node_get_type(child); type = reportxml_node_get_type(child);
refobject_unref(child); refobject_unref(child);
}
/* check for supported configurations */ /* check for supported configurations */
switch (type) { switch (type) {