diff --git a/src/admin.c b/src/admin.c index c6c7561e..88ee2950 100644 --- a/src/admin.c +++ b/src/admin.c @@ -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), "%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 @@ 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, "%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 @@ 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 { diff --git a/src/cfgfile.c b/src/cfgfile.c index 0620f0de..dba3b578 100644 --- a/src/cfgfile.c +++ b/src/cfgfile.c @@ -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) { diff --git a/src/cfgfile.h b/src/cfgfile.h index 6b53d34a..1cc32ba8 100644 --- a/src/cfgfile.h +++ b/src/cfgfile.h @@ -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); diff --git a/src/slave.c b/src/slave.c index 662e2a33..c80d475e 100644 --- a/src/slave.c +++ b/src/slave.c @@ -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);