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
32a410bd
Commit
32a410bd
authored
Jun 09, 2018
by
Philipp Schafft
🦁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Feature: Allow xslt_transform() to send non-200 status
parent
d6a95302
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
7 deletions
+7
-7
src/admin.c
src/admin.c
+1
-1
src/stats.c
src/stats.c
+1
-1
src/xslt.c
src/xslt.c
+4
-4
src/xslt.h
src/xslt.h
+1
-1
No files found.
src/admin.c
View file @
32a410bd
...
...
@@ -463,7 +463,7 @@ void admin_send_response(xmlDocPtr doc,
config_release_config
();
ICECAST_LOG_DEBUG
(
"Sending XSLT (%s)"
,
fullpath_xslt_template
);
xslt_transform
(
doc
,
fullpath_xslt_template
,
client
);
xslt_transform
(
doc
,
fullpath_xslt_template
,
client
,
200
);
free
(
fullpath_xslt_template
);
}
}
...
...
src/stats.c
View file @
32a410bd
...
...
@@ -1024,7 +1024,7 @@ void stats_transform_xslt(client_t *client, const char *uri)
doc
=
stats_get_xml
(
0
,
mount
,
client
->
mode
);
xslt_transform
(
doc
,
xslpath
,
client
);
xslt_transform
(
doc
,
xslpath
,
client
,
200
);
xmlFreeDoc
(
doc
);
free
(
xslpath
);
...
...
src/xslt.c
View file @
32a410bd
...
...
@@ -285,7 +285,7 @@ static xmlDocPtr custom_loader(const xmlChar *URI,
return
ret
;
}
void
xslt_transform
(
xmlDocPtr
doc
,
const
char
*
xslfilename
,
client_t
*
client
)
void
xslt_transform
(
xmlDocPtr
doc
,
const
char
*
xslfilename
,
client_t
*
client
,
int
status
)
{
xmlDocPtr
res
;
xsltStylesheetPtr
cur
;
...
...
@@ -346,7 +346,7 @@ void xslt_transform(xmlDocPtr doc, const char *xslfilename, client_t *client)
if
(
string
==
NULL
)
string
=
xmlCharStrdup
(
""
);
ret
=
util_http_build_header
(
refbuf
->
data
,
full_len
,
0
,
0
,
200
,
NULL
,
mediatype
,
charset
,
NULL
,
NULL
,
client
);
ret
=
util_http_build_header
(
refbuf
->
data
,
full_len
,
0
,
0
,
status
,
NULL
,
mediatype
,
charset
,
NULL
,
NULL
,
client
);
if
(
ret
==
-
1
)
{
ICECAST_LOG_ERROR
(
"Dropping client as we can not build response headers."
);
client_send_error_by_id
(
client
,
ICECAST_ERROR_GEN_HEADER_GEN_FAILED
);
...
...
@@ -359,7 +359,7 @@ void xslt_transform(xmlDocPtr doc, const char *xslfilename, client_t *client)
ICECAST_LOG_DEBUG
(
"Client buffer reallocation succeeded."
);
refbuf
->
data
=
new_data
;
refbuf
->
len
=
full_len
;
ret
=
util_http_build_header
(
refbuf
->
data
,
full_len
,
0
,
0
,
200
,
NULL
,
mediatype
,
charset
,
NULL
,
NULL
,
client
);
ret
=
util_http_build_header
(
refbuf
->
data
,
full_len
,
0
,
0
,
status
,
NULL
,
mediatype
,
charset
,
NULL
,
NULL
,
client
);
if
(
ret
==
-
1
)
{
ICECAST_LOG_ERROR
(
"Dropping client as we can not build response headers."
);
client_send_error_by_id
(
client
,
ICECAST_ERROR_GEN_HEADER_GEN_FAILED
);
...
...
@@ -375,7 +375,7 @@ void xslt_transform(xmlDocPtr doc, const char *xslfilename, client_t *client)
if
(
!
failed
)
{
snprintf
(
refbuf
->
data
+
ret
,
full_len
-
ret
,
"Content-Length: %d
\r\n\r\n
%s"
,
len
,
string
);
client
->
respcode
=
200
;
client
->
respcode
=
status
;
client_set_queue
(
client
,
NULL
);
client
->
refbuf
=
refbuf
;
refbuf
->
len
=
strlen
(
refbuf
->
data
);
...
...
src/xslt.h
View file @
32a410bd
...
...
@@ -16,7 +16,7 @@
#include "icecasttypes.h"
void
xslt_transform
(
xmlDocPtr
doc
,
const
char
*
xslfilename
,
client_t
*
client
);
void
xslt_transform
(
xmlDocPtr
doc
,
const
char
*
xslfilename
,
client_t
*
client
,
int
status
);
void
xslt_initialize
(
void
);
void
xslt_shutdown
(
void
);
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