mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2025-01-03 14:56:34 -05:00
only unlock when we have finished with the stylesheet, potential race otherwise
svn path=/icecast/trunk/icecast/; revision=8723
This commit is contained in:
parent
6c4c02d482
commit
df919a9691
@ -161,9 +161,9 @@ void xslt_transform(xmlDocPtr doc, const char *xslfilename, client_t *client)
|
|||||||
|
|
||||||
thread_mutex_lock(&xsltlock);
|
thread_mutex_lock(&xsltlock);
|
||||||
cur = xslt_get_stylesheet(xslfilename);
|
cur = xslt_get_stylesheet(xslfilename);
|
||||||
thread_mutex_unlock(&xsltlock);
|
|
||||||
|
|
||||||
if (cur == NULL) {
|
if (cur == NULL) {
|
||||||
|
thread_mutex_unlock(&xsltlock);
|
||||||
bytes = sock_write_string(client->con->sock,
|
bytes = sock_write_string(client->con->sock,
|
||||||
(char *)"Could not parse XSLT file");
|
(char *)"Could not parse XSLT file");
|
||||||
if(bytes > 0) client->con->sent_bytes += bytes;
|
if(bytes > 0) client->con->sent_bytes += bytes;
|
||||||
@ -176,6 +176,7 @@ void xslt_transform(xmlDocPtr doc, const char *xslfilename, client_t *client)
|
|||||||
outputBuffer = xmlAllocOutputBuffer(NULL);
|
outputBuffer = xmlAllocOutputBuffer(NULL);
|
||||||
|
|
||||||
count = xsltSaveResultTo(outputBuffer, res, cur);
|
count = xsltSaveResultTo(outputBuffer, res, cur);
|
||||||
|
thread_mutex_unlock(&xsltlock);
|
||||||
|
|
||||||
/* Add null byte to end. */
|
/* Add null byte to end. */
|
||||||
bytes = xmlOutputBufferWrite(outputBuffer, 1, "");
|
bytes = xmlOutputBufferWrite(outputBuffer, 1, "");
|
||||||
|
Loading…
Reference in New Issue
Block a user