[xiph-commits] r9443 - icecast/trunk/icecast/src
karl at motherfish-iii.xiph.org
karl at motherfish-iii.xiph.org
Sun Jun 12 11:43:15 PDT 2005
Author: karl
Date: 2005-06-12 11:43:11 -0700 (Sun, 12 Jun 2005)
New Revision: 9443
Modified:
icecast/trunk/icecast/src/admin.c
icecast/trunk/icecast/src/cfgfile.c
icecast/trunk/icecast/src/cfgfile.h
icecast/trunk/icecast/src/slave.c
Log:
small cleanups. redundant mutex removed, updates to log messages
Modified: icecast/trunk/icecast/src/admin.c
===================================================================
--- icecast/trunk/icecast/src/admin.c 2005-06-12 04:31:41 UTC (rev 9442)
+++ icecast/trunk/icecast/src/admin.c 2005-06-12 18:43:11 UTC (rev 9443)
@@ -234,13 +234,16 @@
xmlNewChild(srcnode, NULL, "fallback",
(source->fallback_mount != NULL)?
source->fallback_mount:"");
- snprintf(buf, sizeof(buf), "%ld", source->listeners);
+ snprintf (buf, sizeof(buf), "%lu", 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 @@
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 @@
xmlDocSetRootElement(doc, node);
memset(buf, '\000', sizeof(buf));
- snprintf(buf, sizeof(buf)-1, "%ld", source->listeners);
+ snprintf (buf, sizeof(buf), "%lu", source->listeners);
xmlNewChild(srcnode, NULL, "Listeners", buf);
avl_tree_rlock(source->client_tree);
@@ -882,7 +887,7 @@
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
{
Modified: icecast/trunk/icecast/src/cfgfile.c
===================================================================
--- icecast/trunk/icecast/src/cfgfile.c 2005-06-12 04:31:41 UTC (rev 9442)
+++ icecast/trunk/icecast/src/cfgfile.c 2005-06-12 18:43:11 UTC (rev 9443)
@@ -88,13 +88,11 @@
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 @@
}
thread_mutex_unlock(&(_locks.relay_lock));
- thread_mutex_lock(&(_locks.mounts_lock));
mount = c->mounts;
while(mount) {
nextmount = mount->next;
@@ -217,7 +214,6 @@
free(mount);
mount = nextmount;
}
- thread_mutex_unlock(&(_locks.mounts_lock));
alias = c->aliases;
while(alias) {
Modified: icecast/trunk/icecast/src/cfgfile.h
===================================================================
--- icecast/trunk/icecast/src/cfgfile.h 2005-06-12 04:31:41 UTC (rev 9442)
+++ icecast/trunk/icecast/src/cfgfile.h 2005-06-12 18:43:11 UTC (rev 9443)
@@ -163,7 +163,6 @@
typedef struct {
rwlock_t config_lock;
mutex_t relay_lock;
- mutex_t mounts_lock;
} ice_config_locks;
void config_initialize(void);
Modified: icecast/trunk/icecast/src/slave.c
===================================================================
--- icecast/trunk/icecast/src/slave.c 2005-06-12 04:31:41 UTC (rev 9442)
+++ icecast/trunk/icecast/src/slave.c 2005-06-12 18:43:11 UTC (rev 9443)
@@ -260,11 +260,11 @@
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);
More information about the commits
mailing list