From 61c9def23886d39325a1a895a67e6195f9419e23 Mon Sep 17 00:00:00 2001 From: Philipp Schafft Date: Thu, 11 Oct 2012 22:28:40 +0000 Subject: [PATCH] cleanup of parser code svn path=/icecast/trunk/icecast/; revision=18649 --- src/cfgfile.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/src/cfgfile.c b/src/cfgfile.c index 5e81d1be..76eb4c0f 100644 --- a/src/cfgfile.c +++ b/src/cfgfile.c @@ -411,15 +411,9 @@ static void _parse_root(xmlDocPtr doc, xmlNodePtr node, _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(" defined outside . 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 @@ static void _parse_authentication(xmlDocPtr doc, xmlNodePtr node, 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 section."); } else { if (configuration->source_password)