[xiph-cvs] cvs commit: icecast/src source.c

Ed oddsock at xiph.org
Thu Jan 15 07:37:26 PST 2004



oddsock     04/01/15 10:37:26

  Modified:    src      source.c
  Log:
  - 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

Revision  Changes    Path
1.64      +18 -2     icecast/src/source.c

Index: source.c
===================================================================
RCS file: /usr/local/cvsroot/icecast/src/source.c,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -r1.63 -r1.64
--- source.c	15 Jan 2004 01:01:09 -0000	1.63
+++ source.c	15 Jan 2004 15:37:25 -0000	1.64
@@ -75,6 +75,7 @@
     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 @@
     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 @@
         }
     }
 #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");
 

<p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list