[xiph-commits] r9775 - in icecast/branches/kh/icecast: doc src

karl at svn.xiph.org karl at svn.xiph.org
Fri Aug 19 14:46:29 PDT 2005


Author: karl
Date: 2005-08-19 14:46:25 -0700 (Fri, 19 Aug 2005)
New Revision: 9775

Modified:
   icecast/branches/kh/icecast/doc/icecast2_config_file.html
   icecast/branches/kh/icecast/src/auth.c
   icecast/branches/kh/icecast/src/cfgfile.c
   icecast/branches/kh/icecast/src/cfgfile.h
Log:
add per-mount time limit for listeners


Modified: icecast/branches/kh/icecast/doc/icecast2_config_file.html
===================================================================
--- icecast/branches/kh/icecast/doc/icecast2_config_file.html	2005-08-19 18:11:52 UTC (rev 9774)
+++ icecast/branches/kh/icecast/doc/icecast2_config_file.html	2005-08-19 21:46:25 UTC (rev 9775)
@@ -381,6 +381,7 @@
         <username>othersource</username>
         <password>hackmemore</password>
         <max-listeners>1</max-listeners>
+        <listening-duration>3600</listening-duration>
         <dump-file>/tmp/dump-example1.ogg</dump-file>
         <intro>/intro.ogg</intro>
         <fallback-mount>/example2.ogg</fallback-mount>
@@ -432,6 +433,11 @@
 <div class="indentedbox">
 An optional value which will set the maximum number of listeners that can be attached to this mountpoint.
 </div>
+<h4>listening-duration</h4>
+<div class="indentedbox">
+    An optional value which will set the length of time a listener will stay connected to the
+    stream. An auth component may override this.
+</div>
 <h4>dump-file</h4>
 <div class="indentedbox">
 An optional value which will set the filename which will be a dump of the stream coming through on this mountpoint.

Modified: icecast/branches/kh/icecast/src/auth.c
===================================================================
--- icecast/branches/kh/icecast/src/auth.c	2005-08-19 18:11:52 UTC (rev 9774)
+++ icecast/branches/kh/icecast/src/auth.c	2005-08-19 21:46:25 UTC (rev 9775)
@@ -311,6 +311,10 @@
             avl_tree_unlock (global.source_tree);
             return -1;
         }
+        /* set a per-mount disconnect time if auth hasn't set one already */
+        if (mountinfo->listening_duration && client->con->discon_time == 0)
+            client->con->discon_time = time(NULL) + mountinfo->listening_duration;
+
         ret = add_client_to_source (source, client);
         avl_tree_unlock (global.source_tree);
         if (ret == 0)

Modified: icecast/branches/kh/icecast/src/cfgfile.c
===================================================================
--- icecast/branches/kh/icecast/src/cfgfile.c	2005-08-19 18:11:52 UTC (rev 9774)
+++ icecast/branches/kh/icecast/src/cfgfile.c	2005-08-19 21:46:25 UTC (rev 9775)
@@ -629,6 +629,11 @@
             mount->on_disconnect = (char *)xmlNodeListGetString(
                     doc, node->xmlChildrenNode, 1);
         }
+        else if (strcmp(node->name, "listening-duration") == 0) {
+            tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
+            mount->listening_duration = atoi(tmp);
+            if(tmp) xmlFree(tmp);
+        }
         else if (strcmp(node->name, "queue-size") == 0) {
             tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
             mount->queue_size_limit = atoi (tmp);

Modified: icecast/branches/kh/icecast/src/cfgfile.h
===================================================================
--- icecast/branches/kh/icecast/src/cfgfile.h	2005-08-19 18:11:52 UTC (rev 9774)
+++ icecast/branches/kh/icecast/src/cfgfile.h	2005-08-19 21:46:25 UTC (rev 9775)
@@ -72,6 +72,7 @@
     config_options_t *auth_options; /* Options for this type */
     char *on_connect;
     char *on_disconnect;
+    unsigned int listening_duration;
 
     char *stream_name;
     char *stream_description;



More information about the commits mailing list