[xiph-commits] r9834 - in icecast/trunk/icecast: doc src

karl at svn.xiph.org karl at svn.xiph.org
Tue Aug 23 12:00:18 PDT 2005


Author: karl
Date: 2005-08-23 12:00:15 -0700 (Tue, 23 Aug 2005)
New Revision: 9834

Modified:
   icecast/trunk/icecast/doc/icecast2_config_file.html
   icecast/trunk/icecast/src/auth.c
   icecast/trunk/icecast/src/cfgfile.c
   icecast/trunk/icecast/src/cfgfile.h
Log:
add per-mount listener time limit setting


Modified: icecast/trunk/icecast/doc/icecast2_config_file.html
===================================================================
--- icecast/trunk/icecast/doc/icecast2_config_file.html	2005-08-23 18:40:20 UTC (rev 9833)
+++ icecast/trunk/icecast/doc/icecast2_config_file.html	2005-08-23 19:00:15 UTC (rev 9834)
@@ -365,6 +365,7 @@
         <username>othersource</username>
         <password>hackmemore</password>
         <max-listeners>1</max-listeners>
+        <max-listener-duration>3600</max-listener-duration>
         <dump-file>/tmp/dump-example1.ogg</dump-file>
         <intro>/intro.ogg</intro>
         <fallback-mount>/example2.ogg</fallback-mount>
@@ -416,6 +417,11 @@
 <div class="indentedbox">
 An optional value which will set the maximum number of listeners that can be attached to this mountpoint.
 </div>
+<h4>max-listener-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/trunk/icecast/src/auth.c
===================================================================
--- icecast/trunk/icecast/src/auth.c	2005-08-23 18:40:20 UTC (rev 9833)
+++ icecast/trunk/icecast/src/auth.c	2005-08-23 19:00:15 UTC (rev 9834)
@@ -322,6 +322,10 @@
             avl_tree_unlock (global.source_tree);
             return -1;
         }
+        /* set a per-mount disconnect time if auth hasn't set one already */
+        if (mountinfo->max_listener_duration && client->con->discon_time == 0)
+            client->con->discon_time = time(NULL) + mountinfo->max_listener_duration;
+
         ret = add_client_to_source (source, client);
         avl_tree_unlock (global.source_tree);
         if (ret == 0)

Modified: icecast/trunk/icecast/src/cfgfile.c
===================================================================
--- icecast/trunk/icecast/src/cfgfile.c	2005-08-23 18:40:20 UTC (rev 9833)
+++ icecast/trunk/icecast/src/cfgfile.c	2005-08-23 19:00:15 UTC (rev 9834)
@@ -615,6 +615,11 @@
             mount->on_disconnect = (char *)xmlNodeListGetString(
                     doc, node->xmlChildrenNode, 1);
         }
+        else if (strcmp(node->name, "max-listener-duration") == 0) {
+            tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
+            mount->max_listener_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/trunk/icecast/src/cfgfile.h
===================================================================
--- icecast/trunk/icecast/src/cfgfile.h	2005-08-23 18:40:20 UTC (rev 9833)
+++ icecast/trunk/icecast/src/cfgfile.h	2005-08-23 19:00:15 UTC (rev 9834)
@@ -72,6 +72,7 @@
     config_options_t *auth_options; /* Options for this type */
     char *on_connect;
     char *on_disconnect;
+    unsigned int max_listener_duration;
 
     char *stream_name;
     char *stream_description;



More information about the commits mailing list