[xiph-commits] r8100 - icecast/trunk/icecast/src

karl at motherfish-iii.xiph.org karl at motherfish-iii.xiph.org
Mon Oct 25 13:46:13 PDT 2004


Author: karl
Date: 2004-10-25 13:46:12 -0700 (Mon, 25 Oct 2004)
New Revision: 8100

Modified:
   icecast/trunk/icecast/src/source.c
Log:
the check for the public stream flag wasn't working correctly in all cases


Modified: icecast/trunk/icecast/src/source.c
===================================================================
--- icecast/trunk/icecast/src/source.c	2004-10-25 20:07:57 UTC (rev 8099)
+++ icecast/trunk/icecast/src/source.c	2004-10-25 20:46:12 UTC (rev 8100)
@@ -494,15 +494,18 @@
             config->hostname, config->port, source->mount);
     config_release_config();
 
-    /* maybe better in connection.c */
-    if ((str = httpp_getvar(source->parser, "ice-public")))
-        source->yp_public = atoi(str);
-    if ((str = httpp_getvar(source->parser, "icy-pub")))
-        source->yp_public = atoi(str);
-    if ((str = httpp_getvar(source->parser, "icy-public")))
-        source->yp_public = atoi(str);
-    if (str == NULL)
-       str = "0";
+    do
+    {
+        if ((str = httpp_getvar(source->parser, "ice-public")))
+            break;
+        if ((str = httpp_getvar(source->parser, "icy-pub")))
+            break;
+        /* handle header from icecast v2 release */
+        if ((str = httpp_getvar(source->parser, "icy-public")))
+            break;
+        str = "0";
+    } while (0);
+    source->yp_public = atoi (str);
     stats_event (source->mount, "public", str);
 
     str = httpp_getvar(source->parser, "ice-audio-info");



More information about the commits mailing list