diff --git a/src/auth.c b/src/auth.c index 1775cc11..5c595e17 100644 --- a/src/auth.c +++ b/src/auth.c @@ -236,6 +236,7 @@ int add_client_to_source (source_t *source, client_t *client) client->next = source->active_clients; source->active_clients = client; source->listeners++; + stats_event_inc (NULL, "listener_connections"); client->write_to_client = format_generic_write_to_client; client->check_buffer = format_check_http_buffer; diff --git a/src/format_mp3.c b/src/format_mp3.c index 00dbb81c..3d74b795 100644 --- a/src/format_mp3.c +++ b/src/format_mp3.c @@ -102,8 +102,7 @@ int format_mp3_get_plugin (source_t *source, http_parser_t *parser) /* initial metadata needs to be blank for sending to clients and for comparing with new metadata */ meta = refbuf_new (17); - memcpy (meta->data, "\001StreamTitle=''", 17); - meta->len = 17; + memcpy (meta->data, "\001StreamTitle='';", 17); state->metadata = meta; state->interval = -1; diff --git a/src/global.c b/src/global.c index cc7a3075..914adf44 100644 --- a/src/global.c +++ b/src/global.c @@ -42,6 +42,7 @@ void global_initialize(void) global.running = 0; global.clients = 0; global.sources = 0; + global.time = time(NULL); global.source_tree = avl_tree_new(source_compare_sources, NULL); thread_mutex_create("global", &_global_mutex); } diff --git a/src/stats.c b/src/stats.c index 5055284d..a4cbcdcf 100644 --- a/src/stats.c +++ b/src/stats.c @@ -559,6 +559,7 @@ static void *_stats_thread(void *arg) stats_event (NULL, "source_relay_connections", "0"); stats_event (NULL, "source_total_connections", "0"); stats_event (NULL, "stats_connections", "0"); + stats_event (NULL, "listener_connections", "0"); INFO0 ("stats thread started"); while (_stats_running) {