Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Icecast-Server
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
93
Issues
93
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
External Wiki
External Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xiph.Org
Icecast-Server
Commits
6f9c20e2
Commit
6f9c20e2
authored
Jun 08, 2018
by
Philipp Schafft
🦁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Feature: Added global (in config) reportxml database
parent
93897aeb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
0 deletions
+28
-0
src/cfgfile.c
src/cfgfile.c
+27
-0
src/cfgfile.h
src/cfgfile.h
+1
-0
No files found.
src/cfgfile.c
View file @
6f9c20e2
...
...
@@ -34,6 +34,8 @@
#include "util.h"
#include "auth.h"
#include "event.h"
#include "refobject.h"
#include "reportxml.h"
/* for config_reread_config() */
#include "yp.h"
...
...
@@ -199,6 +201,7 @@ void config_init_configuration(ice_config_t *configuration)
{
memset
(
configuration
,
0
,
sizeof
(
ice_config_t
));
_set_defaults
(
configuration
);
configuration
->
reportxml_db
=
reportxml_database_new
();
}
static
inline
void
__read_int
(
xmlDocPtr
doc
,
xmlNodePtr
node
,
int
*
val
,
const
char
*
warning
)
...
...
@@ -668,6 +671,9 @@ void config_clear(ice_config_t *c)
#endif
config_clear_http_header
(
c
->
http_headers
);
refobject_unref
(
c
->
reportxml_db
);
memset
(
c
,
0
,
sizeof
(
ice_config_t
));
}
...
...
@@ -2076,6 +2082,27 @@ static void _parse_paths(xmlDocPtr doc,
configuration
->
adminroot_dir
=
(
char
*
)
temp
;
if
(
configuration
->
adminroot_dir
[
strlen
(
configuration
->
adminroot_dir
)
-
1
]
==
'/'
)
configuration
->
adminroot_dir
[
strlen
(
configuration
->
adminroot_dir
)
-
1
]
=
0
;
}
else
if
(
xmlStrcmp
(
node
->
name
,
XMLSTR
(
"reportxmldb"
))
==
0
)
{
reportxml_t
*
report
;
xmlDocPtr
dbdoc
;
if
(
!
(
temp
=
(
char
*
)
xmlNodeListGetString
(
doc
,
node
->
xmlChildrenNode
,
1
)))
{
ICECAST_LOG_WARN
(
"<reportxmldb> setting must not be empty."
);
continue
;
}
dbdoc
=
xmlParseFile
(
temp
);
if
(
!
doc
)
{
ICECAST_LOG_ERROR
(
"Can not read report xml database
\"
%H
\"
as XML"
,
temp
);
}
else
{
report
=
reportxml_parse_xmldoc
(
dbdoc
);
xmlFreeDoc
(
dbdoc
);
if
(
!
report
)
{
ICECAST_LOG_ERROR
(
"Can not parse report xml database
\"
%H
\"
"
,
temp
);
}
else
{
reportxml_database_add_report
(
configuration
->
reportxml_db
,
report
);
}
}
xmlFree
(
temp
);
}
else
if
(
xmlStrcmp
(
node
->
name
,
XMLSTR
(
"resource"
))
==
0
||
xmlStrcmp
(
node
->
name
,
XMLSTR
(
"alias"
))
==
0
)
{
_parse_resource
(
doc
,
node
,
configuration
);
}
...
...
src/cfgfile.h
View file @
6f9c20e2
...
...
@@ -223,6 +223,7 @@ struct ice_config_tag {
char
*
webroot_dir
;
char
*
adminroot_dir
;
resource_t
*
resources
;
reportxml_database_t
*
reportxml_db
;
char
*
access_log
;
char
*
error_log
;
...
...
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