Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xiph.Org
Icecast-Server
Commits
88bfe6ba
Commit
88bfe6ba
authored
Jun 12, 2005
by
Karl Heyes
Browse files
small cleanups. redundant mutex removed, updates to log messages
svn path=/icecast/trunk/icecast/; revision=9443
parent
c59a276a
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/admin.c
View file @
88bfe6ba
...
...
@@ -234,13 +234,16 @@ xmlDocPtr admin_build_sourcelist (const char *mount)
xmlNewChild
(
srcnode
,
NULL
,
"fallback"
,
(
source
->
fallback_mount
!=
NULL
)
?
source
->
fallback_mount
:
""
);
snprintf
(
buf
,
sizeof
(
buf
),
"%l
d
"
,
source
->
listeners
);
snprintf
(
buf
,
sizeof
(
buf
),
"%l
u
"
,
source
->
listeners
);
xmlNewChild
(
srcnode
,
NULL
,
"listeners"
,
buf
);
snprintf
(
buf
,
sizeof
(
buf
),
"%lu"
,
(
unsigned
long
)(
now
-
source
->
con
->
con_time
));
xmlNewChild
(
srcnode
,
NULL
,
"Connected"
,
buf
);
xmlNewChild
(
srcnode
,
NULL
,
"content-type"
,
source
->
format
->
contenttype
);
if
(
source
->
running
)
{
snprintf
(
buf
,
sizeof
(
buf
),
"%lu"
,
(
unsigned
long
)(
now
-
source
->
con
->
con_time
));
xmlNewChild
(
srcnode
,
NULL
,
"Connected"
,
buf
);
xmlNewChild
(
srcnode
,
NULL
,
"content-type"
,
source
->
format
->
contenttype
);
}
if
(
source
->
authenticator
)
{
xmlNewChild
(
srcnode
,
NULL
,
"authenticator"
,
source
->
authenticator
->
type
);
...
...
@@ -596,6 +599,8 @@ static void command_move_clients(client_t *client, source_t *source,
return
;
}
INFO2
(
"source is
\"
%s
\"
, destination is
\"
%s
\"
"
,
source
->
mount
,
dest
->
mount
);
doc
=
xmlNewDoc
(
"1.0"
);
node
=
xmlNewDocNode
(
doc
,
NULL
,
"iceresponse"
,
NULL
);
xmlDocSetRootElement
(
doc
,
node
);
...
...
@@ -632,7 +637,7 @@ static void command_show_listeners(client_t *client, source_t *source,
xmlDocSetRootElement
(
doc
,
node
);
memset
(
buf
,
'\000'
,
sizeof
(
buf
));
snprintf
(
buf
,
sizeof
(
buf
)
-
1
,
"%l
d
"
,
source
->
listeners
);
snprintf
(
buf
,
sizeof
(
buf
),
"%l
u
"
,
source
->
listeners
);
xmlNewChild
(
srcnode
,
NULL
,
"Listeners"
,
buf
);
avl_tree_rlock
(
source
->
client_tree
);
...
...
@@ -882,7 +887,7 @@ static void command_metadata(client_t *client, source_t *source,
if
(
song
)
{
plugin
->
set_tag
(
plugin
,
"song"
,
song
);
DEBUG2
(
"Metadata on mountpoint %s changed to
\"
%s
\"
"
,
source
->
mount
,
song
);
INFO2
(
"Metadata on mountpoint %s changed to
\"
%s
\"
"
,
source
->
mount
,
song
);
}
else
{
...
...
src/cfgfile.c
View file @
88bfe6ba
...
...
@@ -88,13 +88,11 @@ static void _add_server(xmlDocPtr doc, xmlNodePtr node, ice_config_t *c);
static
void
create_locks
()
{
thread_mutex_create
(
&
_locks
.
relay_lock
);
thread_mutex_create
(
&
_locks
.
mounts_lock
);
thread_rwlock_create
(
&
_locks
.
config_lock
);
}
static
void
release_locks
()
{
thread_mutex_destroy
(
&
_locks
.
relay_lock
);
thread_mutex_destroy
(
&
_locks
.
mounts_lock
);
thread_rwlock_destroy
(
&
_locks
.
config_lock
);
}
...
...
@@ -182,7 +180,6 @@ void config_clear(ice_config_t *c)
}
thread_mutex_unlock
(
&
(
_locks
.
relay_lock
));
thread_mutex_lock
(
&
(
_locks
.
mounts_lock
));
mount
=
c
->
mounts
;
while
(
mount
)
{
nextmount
=
mount
->
next
;
...
...
@@ -217,7 +214,6 @@ void config_clear(ice_config_t *c)
free
(
mount
);
mount
=
nextmount
;
}
thread_mutex_unlock
(
&
(
_locks
.
mounts_lock
));
alias
=
c
->
aliases
;
while
(
alias
)
{
...
...
src/cfgfile.h
View file @
88bfe6ba
...
...
@@ -163,7 +163,6 @@ typedef struct ice_config_tag
typedef
struct
{
rwlock_t
config_lock
;
mutex_t
relay_lock
;
mutex_t
mounts_lock
;
}
ice_config_locks
;
void
config_initialize
(
void
);
...
...
src/slave.c
View file @
88bfe6ba
...
...
@@ -260,11 +260,11 @@ static void *start_relay_stream (void *arg)
return
NULL
;
}
while
(
0
);
DEBUG1
(
"failed relay, fallback to %s"
,
relay
->
source
->
fallback_mount
);
if
(
relay
->
source
->
fallback_mount
)
{
source_t
*
fallback_source
;
DEBUG1
(
"failed relay, fallback to %s"
,
relay
->
source
->
fallback_mount
);
avl_tree_rlock
(
global
.
source_tree
);
fallback_source
=
source_find_mount
(
relay
->
source
->
fallback_mount
);
...
...
Write
Preview
Supports
Markdown
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