Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Icecast-Server
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
102
Issues
102
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
External Wiki
External Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xiph.Org
Icecast-Server
Commits
bfcac5d3
Commit
bfcac5d3
authored
Aug 08, 2018
by
Philipp Schafft
🦁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Feature: Unifiy response root node generation a bit and make the module list universally available
parent
d711ea15
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
11 deletions
+22
-11
admin/includes/header.xsl
admin/includes/header.xsl
+1
-1
src/admin.c
src/admin.c
+21
-10
No files found.
admin/includes/header.xsl
View file @
bfcac5d3
...
...
@@ -14,7 +14,7 @@
<ul>
<li
class=
"on"
><a
href=
"/admin/stats.xsl"
>
Administration
</a></li>
<li><a
href=
"/admin/listmounts.xsl"
>
Mountpoint list
</a></li>
<xsl:for-each
select=
"(/report/extension
| /)/icestats
/modules/module"
>
<xsl:for-each
select=
"(/report/extension
/icestats | /icestats | /iceresponse)
/modules/module"
>
<xsl:if
test=
"@management-url and @management-title"
>
<li><a
href=
"{@management-url}"
><xsl:value-of
select=
"@management-title"
/></a></li>
</xsl:if>
...
...
src/admin.c
View file @
bfcac5d3
...
...
@@ -317,6 +317,17 @@ int admin_command_table_unregister(const char *prefix)
return
-
1
;
}
/* build an XML root node including some common tags */
xmlNodePtr
admin_build_rootnode
(
xmlDocPtr
doc
,
const
char
*
name
)
{
xmlNodePtr
rootnode
=
xmlNewDocNode
(
doc
,
NULL
,
XMLSTR
(
name
),
NULL
);
xmlNodePtr
modules
=
module_container_get_modulelist_as_xml
(
global
.
modulecontainer
);
xmlAddChild
(
rootnode
,
modules
);
return
rootnode
;
}
/* build an XML doc containing information about currently running sources.
* If a mountpoint is passed then that source will not be added to the XML
* doc even if the source is running */
...
...
@@ -330,7 +341,7 @@ xmlDocPtr admin_build_sourcelist(const char *mount)
time_t
now
=
time
(
NULL
);
doc
=
xmlNewDoc
(
XMLSTR
(
"1.0"
));
xmlnode
=
xmlNewDocNode
(
doc
,
NULL
,
XMLSTR
(
"icestats"
),
NULL
);
xmlnode
=
admin_build_rootnode
(
doc
,
"icestats"
);
xmlDocSetRootElement
(
doc
,
xmlnode
);
if
(
mount
)
{
...
...
@@ -649,7 +660,7 @@ static void command_move_clients(client_t *client,
ICECAST_LOG_INFO
(
"source is
\"
%s
\"
, destination is
\"
%s
\"
"
,
source
->
mount
,
dest
->
mount
);
doc
=
xmlNewDoc
(
XMLSTR
(
"1.0"
));
node
=
xmlNewDocNode
(
doc
,
NULL
,
XMLSTR
(
"iceresponse"
),
NULL
);
node
=
admin_build_rootnode
(
doc
,
"iceresponse"
);
xmlDocSetRootElement
(
doc
,
node
);
source_move_clients
(
source
,
dest
);
...
...
@@ -744,7 +755,7 @@ static void command_show_listeners(client_t *client,
char
buf
[
22
];
doc
=
xmlNewDoc
(
XMLSTR
(
"1.0"
));
node
=
xmlNewDocNode
(
doc
,
NULL
,
XMLSTR
(
"icestats"
),
NULL
);
node
=
admin_build_rootnode
(
doc
,
"icestats"
);
srcnode
=
xmlNewChild
(
node
,
NULL
,
XMLSTR
(
"source"
),
NULL
);
xmlSetProp
(
srcnode
,
XMLSTR
(
"mount"
),
XMLSTR
(
source
->
mount
));
xmlDocSetRootElement
(
doc
,
node
);
...
...
@@ -902,12 +913,12 @@ static void command_manageauth(client_t *client, source_t *source, admin_format_
}
doc
=
xmlNewDoc
(
XMLSTR
(
"1.0"
));
node
=
xmlNewDocNode
(
doc
,
NULL
,
XMLSTR
(
"icestats"
),
NULL
);
node
=
admin_build_rootnode
(
doc
,
"icestats"
);
rolenode
=
admin_add_role_to_authentication
(
auth
,
node
);
if
(
message
)
{
msgnode
=
xmlNewChild
(
node
,
NULL
,
XMLSTR
(
"iceresponse"
),
NULL
);
msgnode
=
admin_build_rootnode
(
doc
,
"iceresponse"
);
xmlNewTextChild
(
msgnode
,
NULL
,
XMLSTR
(
"message"
),
XMLSTR
(
message
));
}
...
...
@@ -941,7 +952,7 @@ static void command_kill_source(client_t *client,
xmlNodePtr
node
;
doc
=
xmlNewDoc
(
XMLSTR
(
"1.0"
));
node
=
xmlNewDocNode
(
doc
,
NULL
,
XMLSTR
(
"iceresponse"
),
NULL
);
node
=
admin_build_rootnode
(
doc
,
"iceresponse"
);
xmlNewTextChild
(
node
,
NULL
,
XMLSTR
(
"message"
),
XMLSTR
(
"Source Removed"
));
xmlNewTextChild
(
node
,
NULL
,
XMLSTR
(
"return"
),
XMLSTR
(
"1"
));
xmlDocSetRootElement
(
doc
,
node
);
...
...
@@ -971,7 +982,7 @@ static void command_kill_client(client_t *client,
listener
=
source_find_client
(
source
,
id
);
doc
=
xmlNewDoc
(
XMLSTR
(
"1.0"
));
node
=
xmlNewDocNode
(
doc
,
NULL
,
XMLSTR
(
"iceresponse"
),
NULL
);
node
=
admin_build_rootnode
(
doc
,
"iceresponse"
);
xmlDocSetRootElement
(
doc
,
node
);
ICECAST_LOG_DEBUG
(
"Response is %d"
,
response
);
...
...
@@ -1028,7 +1039,7 @@ static void command_metadata(client_t *client,
int
same_ip
=
1
;
doc
=
xmlNewDoc
(
XMLSTR
(
"1.0"
));
node
=
xmlNewDocNode
(
doc
,
NULL
,
XMLSTR
(
"iceresponse"
),
NULL
);
node
=
admin_build_rootnode
(
doc
,
"iceresponse"
);
xmlDocSetRootElement
(
doc
,
node
);
ICECAST_LOG_DEBUG
(
"Got metadata update request"
);
...
...
@@ -1155,7 +1166,7 @@ static void command_queue_reload(client_t *client, source_t *source, admin_forma
global_unlock
();
doc
=
xmlNewDoc
(
XMLSTR
(
"1.0"
));
node
=
xmlNewDocNode
(
doc
,
NULL
,
XMLSTR
(
"iceresponse"
),
NULL
);
node
=
admin_build_rootnode
(
doc
,
"iceresponse"
);
xmlNewTextChild
(
node
,
NULL
,
XMLSTR
(
"message"
),
XMLSTR
(
"Config reload queued"
));
xmlNewTextChild
(
node
,
NULL
,
XMLSTR
(
"return"
),
XMLSTR
(
"1"
));
xmlDocSetRootElement
(
doc
,
node
);
...
...
@@ -1207,7 +1218,7 @@ static void command_updatemetadata(client_t *client,
xmlNodePtr
node
,
srcnode
;
doc
=
xmlNewDoc
(
XMLSTR
(
"1.0"
));
node
=
xmlNewDocNode
(
doc
,
NULL
,
XMLSTR
(
"icestats"
),
NULL
);
node
=
admin_build_rootnode
(
doc
,
"icestats"
);
srcnode
=
xmlNewChild
(
node
,
NULL
,
XMLSTR
(
"source"
),
NULL
);
xmlSetProp
(
srcnode
,
XMLSTR
(
"mount"
),
XMLSTR
(
source
->
mount
));
xmlDocSetRootElement
(
doc
,
node
);
...
...
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