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

karl at svn.xiph.org karl at svn.xiph.org
Wed Dec 19 11:09:06 PST 2007


Author: karl
Date: 2007-12-19 11:09:04 -0800 (Wed, 19 Dec 2007)
New Revision: 14314

Modified:
   icecast/trunk/icecast/src/cfgfile.c
Log:
port 8000 could be set to listen on when not wanted


Modified: icecast/trunk/icecast/src/cfgfile.c
===================================================================
--- icecast/trunk/icecast/src/cfgfile.c	2007-12-18 10:43:58 UTC (rev 14313)
+++ icecast/trunk/icecast/src/cfgfile.c	2007-12-19 19:09:04 UTC (rev 14314)
@@ -483,6 +483,14 @@
             _parse_security(doc, node->xmlChildrenNode, configuration);
         }
     } while ((node = node->next));
+
+    /* drop the first listening socket details if more than one is defined, as we only
+     * have port or listen-socket not both */
+    if (configuration->listen_sock_count > 1)
+    {
+        configuration->listen_sock = config_clear_listener (configuration->listen_sock);
+        configuration->listen_sock_count--;
+    }
 }
 
 static void _parse_limits(xmlDocPtr doc, xmlNodePtr node, 
@@ -813,8 +821,10 @@
         }
     } while ((node = node->next));
 
-    listener->next = configuration->listen_sock;
-    configuration->listen_sock = listener;
+    /* we know there's at least one of these, so add this new one after the first
+     * that way it can be removed easily later on */
+    listener->next = configuration->listen_sock->next;
+    configuration->listen_sock->next = listener;
     configuration->listen_sock_count++;
     if (listener->shoutcast_mount)
     {
@@ -825,8 +835,8 @@
         if (listener->bind_address)
             sc_port->bind_address = (char*)xmlStrdup (XMLSTR(listener->bind_address));
 
-        sc_port->next = configuration->listen_sock;
-        configuration->listen_sock = sc_port;
+        sc_port->next = listener->next;
+        listener->next = sc_port;
         configuration->listen_sock_count++;
     }
 }



More information about the commits mailing list