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

ph3-der-loewe at svn.xiph.org ph3-der-loewe at svn.xiph.org
Thu Oct 11 15:28:40 PDT 2012


Author: ph3-der-loewe
Date: 2012-10-11 15:28:40 -0700 (Thu, 11 Oct 2012)
New Revision: 18649

Modified:
   icecast/trunk/icecast/src/cfgfile.c
Log:
cleanup of <source-password> parser code

Modified: icecast/trunk/icecast/src/cfgfile.c
===================================================================
--- icecast/trunk/icecast/src/cfgfile.c	2012-10-11 18:06:30 UTC (rev 18648)
+++ icecast/trunk/icecast/src/cfgfile.c	2012-10-11 22:28:40 UTC (rev 18649)
@@ -411,15 +411,9 @@
             _parse_authentication(doc, node->xmlChildrenNode, configuration);
         } else if (xmlStrcmp (node->name, XMLSTR("source-password")) == 0) {
             /* TODO: This is the backwards-compatibility location */
-            char *mount, *pass;
-            if ((mount = (char *)xmlGetProp(node, XMLSTR("mount"))) != NULL) {
-                pass = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
-                /* FIXME: This is a placeholder for per-mount passwords */
-            }
-            else {
-                if (configuration->source_password) xmlFree(configuration->source_password);
-                configuration->source_password = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
-            }
+            WARN0("<source-password> defined outside <authentication>. This is deprecated.");
+            if (configuration->source_password) xmlFree(configuration->source_password);
+            configuration->source_password = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
         } else if (xmlStrcmp (node->name, XMLSTR("icelogin")) == 0) {
             tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
             configuration->ice_login = atoi(tmp);
@@ -864,10 +858,8 @@
         if (xmlIsBlankNode(node)) continue;
 
         if (xmlStrcmp (node->name, XMLSTR("source-password")) == 0) {
-            char *mount, *pass;
-            if ((mount = (char *)xmlGetProp(node, XMLSTR("mount"))) != NULL) {
-                pass = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
-                /* FIXME: This is a placeholder for per-mount passwords */
+            if (xmlGetProp(node, XMLSTR("mount"))) {
+                ERROR0("Mount level source password defined within global <authentication> section.");
             }
             else {
                 if (configuration->source_password)



More information about the commits mailing list