Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xiph.Org
Icecast-Server
Commits
110a8414
Commit
110a8414
authored
Feb 23, 2014
by
Thomas B. Rücker
😊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Send charset in headers for everything, excluding file-serv and streams.
svn path=/icecast/trunk/icecast/; revision=19096
parent
c24fcc35
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
6 deletions
+10
-6
src/admin.c
src/admin.c
+3
-3
src/client.c
src/client.c
+1
-1
src/xslt.c
src/xslt.c
+6
-2
No files found.
src/admin.c
View file @
110a8414
...
...
@@ -278,7 +278,7 @@ void admin_send_response (xmlDocPtr doc, client_t *client,
/* FIXME: in this section we hope no function will ever return -1 */
len
=
util_http_build_header
(
client
->
refbuf
->
data
,
buf_len
,
0
,
0
,
200
,
NULL
,
"text/xml"
,
NULL
,
"text/xml"
,
"utf-8"
,
NULL
);
len
+=
snprintf
(
client
->
refbuf
->
data
+
len
,
buf_len
-
len
,
"Content-Length: %d
\r\n\r\n
%s"
,
xmlStrlen
(
buff
),
buff
);
...
...
@@ -572,7 +572,7 @@ static void html_success(client_t *client, char *message)
ret
=
util_http_build_header
(
client
->
refbuf
->
data
,
PER_CLIENT_REFBUF_SIZE
,
0
,
0
,
200
,
NULL
,
"text/html"
,
NULL
,
"text/html"
,
"utf-8"
,
""
);
snprintf
(
client
->
refbuf
->
data
+
ret
,
PER_CLIENT_REFBUF_SIZE
-
ret
,
"<html><head><title>Admin request successful</title></head>"
...
...
@@ -1031,7 +1031,7 @@ static void command_list_mounts(client_t *client, int response)
{
util_http_build_header
(
client
->
refbuf
->
data
,
PER_CLIENT_REFBUF_SIZE
,
0
,
0
,
200
,
NULL
,
"text/plain"
,
NULL
,
"text/plain"
,
"utf-8"
,
""
);
client
->
refbuf
->
len
=
strlen
(
client
->
refbuf
->
data
);
client
->
respcode
=
200
;
...
...
src/client.c
View file @
110a8414
...
...
@@ -189,7 +189,7 @@ static void client_send_error(client_t *client, int status, int plain, const cha
ret
=
util_http_build_header
(
client
->
refbuf
->
data
,
PER_CLIENT_REFBUF_SIZE
,
0
,
0
,
status
,
NULL
,
plain
?
"text/plain"
:
"text/html"
,
NULL
,
plain
?
"text/plain"
:
"text/html"
,
"utf-8"
,
plain
?
message
:
""
);
if
(
!
plain
)
...
...
src/xslt.c
View file @
110a8414
...
...
@@ -191,6 +191,7 @@ void xslt_transform(xmlDocPtr doc, const char *xslfilename, client_t *client)
xmlChar
*
string
;
int
len
,
problem
=
0
;
const
char
*
mediatype
=
NULL
;
const
char
*
charset
=
NULL
;
xmlSetGenericErrorFunc
(
""
,
log_parse_failure
);
xsltSetGenericErrorFunc
(
""
,
log_parse_failure
);
...
...
@@ -211,7 +212,10 @@ void xslt_transform(xmlDocPtr doc, const char *xslfilename, client_t *client)
if
(
xsltSaveResultToString
(
&
string
,
&
len
,
res
,
cur
)
<
0
)
problem
=
1
;
/* lets find out the content type to use */
/* lets find out the content type and character encoding to use */
if
(
cur
->
encoding
)
charset
=
(
char
*
)
cur
->
encoding
;
if
(
cur
->
mediaType
)
mediatype
=
(
char
*
)
cur
->
mediaType
;
else
...
...
@@ -234,7 +238,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
,
NULL
,
NULL
);
ret
=
util_http_build_header
(
refbuf
->
data
,
full_len
,
0
,
0
,
200
,
NULL
,
mediatype
,
charset
,
NULL
);
snprintf
(
refbuf
->
data
+
ret
,
full_len
-
ret
,
"Content-Length: %d
\r\n\r\n
%s"
,
len
,
string
);
...
...
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