From 8a78baa149b6a62955ef4ec5fc43156f9d62ddf0 Mon Sep 17 00:00:00 2001 From: oddsock Date: Thu, 15 Jan 2004 15:37:25 +0000 Subject: [PATCH] - properly initialize the authorizer structure, otherwise by default it is enabled - add new element (listenurl) to the stats for use in things like java player applets svn path=/trunk/icecast/; revision=5763 --- src/source.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/source.c b/src/source.c index f15d10e5..444609c6 100644 --- a/src/source.c +++ b/src/source.c @@ -75,6 +75,7 @@ source_t *source_create(client_t *client, connection_t *con, src->yp_public = 0; src->fallback_override = 0; src->no_mount = 0; + src->authenticator = NULL; if(mountinfo != NULL) { if (mountinfo->fallback_mount != NULL) @@ -257,19 +258,20 @@ void *source_main(void *arg) long current_time; int i; char *ai; - int listen_url_size; #endif long queue_limit; ice_config_t *config; char *hostname; + char *listenurl; + int listen_url_size; int port; config = config_get_config(); queue_limit = config->queue_size_limit; timeout = config->source_timeout; - hostname = config->hostname; + hostname = strdup(config->hostname); port = config->port; #ifdef USE_YP @@ -409,6 +411,20 @@ void *source_main(void *arg) } } #endif + /* 6 for max size of port */ + listen_url_size = strlen("http://") + + strlen(hostname) + strlen(":") + 6 + strlen(source->mount) + 1; + + listenurl = malloc(listen_url_size); + memset(listenurl, '\000', listen_url_size); + sprintf(listenurl, "http://%s:%d%s", hostname, port, source->mount); + stats_event(source->mount, "listenurl", listenurl); + if (hostname) { + free(hostname); + } + if (listenurl) { + free(listenurl); + } DEBUG0("Source creation complete");