Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xiph.Org
Icecast-Server
Commits
450d4484
Commit
450d4484
authored
Feb 25, 2004
by
Karl Heyes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add missing lock on source tree
svn path=/trunk/icecast/; revision=5865
parent
32f52c62
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
10 deletions
+25
-10
src/admin.c
src/admin.c
+25
-10
No files found.
src/admin.c
View file @
450d4484
...
...
@@ -699,28 +699,43 @@ static void command_stats(client_t *client, int response) {
return
;
}
static
void
command_list_mounts
(
client_t
*
client
,
int
response
)
{
xmlDocPtr
doc
;
static
void
command_list_mounts
(
client_t
*
client
,
int
response
)
{
avl_node
*
node
;
source_t
*
source
;
DEBUG0
(
"List mounts request"
);
avl_tree_rlock
(
global
.
source_tree
);
if
(
response
==
PLAINTEXT
)
{
char
buffer
[
4096
],
*
buf
=
buffer
;
unsigned
remaining
=
sizeof
(
buffer
);
int
ret
=
sprintf
(
buffer
,
"HTTP/1.0 200 OK
\r\n
Content-Type: text/html
\r\n\r\n
"
);
node
=
avl_get_first
(
global
.
source_tree
);
html_write
(
client
,
"HTTP/1.0 200 OK
\r\n
Content-Type: text/html
\r\n\r\n
"
);
while
(
node
)
{
while
(
node
&&
ret
>
0
&&
ret
<
remaining
)
{
remaining
-=
ret
;
buf
+=
ret
;
source
=
(
source_t
*
)
node
->
key
;
html_write
(
client
,
"%s
\n
"
,
source
->
mount
);
ret
=
snprintf
(
buf
,
remaining
,
"%s
\n
"
,
source
->
mount
);
node
=
avl_get_next
(
node
);
}
avl_tree_unlock
(
global
.
source_tree
);
/* handle last line */
if
(
ret
>
0
&&
ret
<
remaining
)
{
remaining
-=
ret
;
buf
+=
ret
;
}
sock_write_bytes
(
client
->
con
->
sock
,
buffer
,
sizeof
(
buffer
)
-
remaining
);
}
else
{
doc
=
admin_build_sourcelist
(
NULL
);
else
{
xmlDocPtr
doc
=
admin_build_sourcelist
(
NULL
);
avl_tree_unlock
(
global
.
source_tree
);
admin_send_response
(
doc
,
client
,
response
,
LISTMOUNTS_TRANSFORMED_REQUEST
);
...
...
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