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

karl at motherfish-iii.xiph.org karl at motherfish-iii.xiph.org
Sun Nov 21 07:51:50 PST 2004


Author: karl
Date: 2004-11-21 07:51:49 -0800 (Sun, 21 Nov 2004)
New Revision: 8241

Modified:
   icecast/trunk/icecast/conf/icecast.xml.in
   icecast/trunk/icecast/doc/icecast2_config_file.html
   icecast/trunk/icecast/src/cfgfile.c
   icecast/trunk/icecast/src/cfgfile.h
   icecast/trunk/icecast/src/source.c
   icecast/trunk/icecast/src/source.h
Log:
add per-mount no-yp tag handling


Modified: icecast/trunk/icecast/conf/icecast.xml.in
===================================================================
--- icecast/trunk/icecast/conf/icecast.xml.in	2004-11-21 06:47:53 UTC (rev 8240)
+++ icecast/trunk/icecast/conf/icecast.xml.in	2004-11-21 15:51:49 UTC (rev 8241)
@@ -91,6 +91,7 @@
         <burst-size>65536</burst-size>
         <fallback-mount>/example2.ogg</fallback-mount>
         <fallback-override>1</fallback-override>
+        <no-yp>1</no-yp>
         <authentication type="htpasswd">
                 <option name="filename" value="myauth"/>
                 <option name="allow_duplicate_users" value="0"/>

Modified: icecast/trunk/icecast/doc/icecast2_config_file.html
===================================================================
--- icecast/trunk/icecast/doc/icecast2_config_file.html	2004-11-21 06:47:53 UTC (rev 8240)
+++ icecast/trunk/icecast/doc/icecast2_config_file.html	2004-11-21 15:51:49 UTC (rev 8241)
@@ -320,6 +320,7 @@
         &lt;dump-file&gt;/tmp/dump-example1.ogg&lt;/dump-file&gt;
         &lt;fallback-mount&gt;/example2.ogg&lt;/fallback-mount&gt;
         &lt;fallback-override&gt;1&lt;/fallback-override&gt;
+        &lt;no-yp&gt;1&lt;/no-yp&gt;
         &lt;burst-size&gt;65536&lt;/burst-size&gt;
         &lt;authentication type="htpasswd"&gt;
                 &lt;option name="filename" value="myauth"/&gt;
@@ -367,6 +368,12 @@
 When enabled, this allows a connecting source client or relay on this mountpoint to move
 listening clients back from the fallback mount.
 </div>
+<h4>no-yp</h4>
+<div class="indentedbox">
+Setting this option prevents this mountpoint from advertising on YP.  The default is 0 so YP
+advertising occurs however you may want to prevent it here if you intend listeners to connect
+to a local relay instead
+</div>
 <h4>burst-size</h4>
 <div class="indentedbox">
 This optional setting allows for providing a burst size which overrides the default burst size

Modified: icecast/trunk/icecast/src/cfgfile.c
===================================================================
--- icecast/trunk/icecast/src/cfgfile.c	2004-11-21 06:47:53 UTC (rev 8240)
+++ icecast/trunk/icecast/src/cfgfile.c	2004-11-21 15:51:49 UTC (rev 8241)
@@ -553,6 +553,11 @@
             mount->no_mount = atoi(tmp);
             if(tmp) xmlFree(tmp);
         }
+        else if (strcmp(node->name, "no-yp") == 0) {
+            tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
+            mount->no_yp = atoi(tmp);
+            if(tmp) xmlFree(tmp);
+        }
         else if (strcmp(node->name, "authentication") == 0) {
             mount->auth_type = xmlGetProp(node, "type");
             option = node->xmlChildrenNode;

Modified: icecast/trunk/icecast/src/cfgfile.h
===================================================================
--- icecast/trunk/icecast/src/cfgfile.h	2004-11-21 06:47:53 UTC (rev 8240)
+++ icecast/trunk/icecast/src/cfgfile.h	2004-11-21 15:51:49 UTC (rev 8241)
@@ -57,6 +57,7 @@
     int burst_size; /* amount to send to a new client if possible, -1 take
                      * from global setting */
     unsigned int queue_size_limit;
+    int no_yp; /* Do we prevent YP on this mount */
     unsigned int source_timeout;  /* source timeout in seconds */
 
     char *auth_type; /* Authentication type */

Modified: icecast/trunk/icecast/src/source.c
===================================================================
--- icecast/trunk/icecast/src/source.c	2004-11-21 06:47:53 UTC (rev 8240)
+++ icecast/trunk/icecast/src/source.c	2004-11-21 15:51:49 UTC (rev 8241)
@@ -242,6 +242,7 @@
     source->shoutcast_compat = 0;
     source->max_listeners = -1;
     source->yp_public = 0;
+    source->yp_prevent = 0;
     util_dict_free (source->audio_info);
     source->audio_info = NULL;
 
@@ -498,6 +499,9 @@
 
     do
     {
+        str = "0";
+        if (source->yp_prevent)
+            break;
         if ((str = httpp_getvar(source->parser, "ice-public")))
             break;
         if ((str = httpp_getvar(source->parser, "icy-pub")))
@@ -877,6 +881,12 @@
         source->timeout = mountinfo->source_timeout;
         DEBUG1 ("source timeout to %u", source->timeout);
     }
+    if (mountinfo->no_yp)
+    {
+        source->yp_prevent = 1;
+        DEBUG0 ("preventing YP listings");
+    }
+
     if (mountinfo->burst_size > -1)
         source->burst_size = mountinfo->burst_size;
     DEBUG1 ("amount to burst on client connect set to %u", source->burst_size);

Modified: icecast/trunk/icecast/src/source.h
===================================================================
--- icecast/trunk/icecast/src/source.h	2004-11-21 06:47:53 UTC (rev 8240)
+++ icecast/trunk/icecast/src/source.h	2004-11-21 15:51:49 UTC (rev 8241)
@@ -51,6 +51,7 @@
     long listeners;
     long max_listeners;
     int yp_public;
+    int yp_prevent;
     struct auth_tag *authenticator;
     int fallback_override;
     int no_mount;



More information about the commits mailing list