1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-09-22 04:15:54 -04:00

added warnings on empty and default values of <fileserve>, <hostname>, <location>, <admin> and <server-id>

svn path=/icecast/trunk/icecast/; revision=19276
This commit is contained in:
Philipp Schafft 2014-11-07 19:14:28 +00:00
parent 0b7e65c3c9
commit 70f8d14d1c

View File

@ -470,6 +470,7 @@ static void _parse_root(xmlDocPtr doc, xmlNodePtr node,
} else if (xmlStrcmp (node->name, XMLSTR("server-id")) == 0) {
xmlFree (configuration->server_id);
configuration->server_id = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
ICECAST_LOG_WARN("Warning, server version string override detected. This may lead to unexpected client software behavior.");
} else if(xmlStrcmp (node->name, XMLSTR("authentication")) == 0) {
_parse_authentication(doc, node->xmlChildrenNode, configuration);
} else if (xmlStrcmp (node->name, XMLSTR("source-password")) == 0) {
@ -558,6 +559,28 @@ static void _parse_root(xmlDocPtr doc, xmlNodePtr node,
}
if (configuration->port == 0)
configuration->port = 8000;
/* issue some warnings on bad configurations */
if (!configuration->fileserve)
ICECAST_LOG_WARN("Warning, serving of static files has been disabled in the config, this will also affect files used by the web interface (stylesheets, images).");
if (!configuration->hostname || strcmp(configuration->hostname, CONFIG_DEFAULT_HOSTNAME) == 0) {
ICECAST_LOG_WARN("Warning, <hostname> not configured, using default value \"%s\". This will cause problems, e.g. with YP directory listings.", CONFIG_DEFAULT_HOSTNAME);
if (!configuration->hostname)
configuration->hostname = (char *)xmlCharStrdup (CONFIG_DEFAULT_HOSTNAME);
}
if (!configuration->location || strcmp(configuration->location, CONFIG_DEFAULT_LOCATION) == 0) {
ICECAST_LOG_WARN("Warning, <location> not configured, using default value \"%s\".", CONFIG_DEFAULT_LOCATION);
if (!configuration->location)
configuration->location = (char *)xmlCharStrdup (CONFIG_DEFAULT_LOCATION);
}
if (!configuration->admin || strcmp(configuration->admin, CONFIG_DEFAULT_ADMIN) == 0) {
ICECAST_LOG_WARN("Warning, <admin> contact not configured, using default value \"%s\".", CONFIG_DEFAULT_ADMIN);
if (!configuration->admin)
configuration->admin = (char *)xmlCharStrdup (CONFIG_DEFAULT_ADMIN);
}
}
static void _parse_limits(xmlDocPtr doc, xmlNodePtr node,