Commit 11d5dffd authored by Philipp Schafft's avatar Philipp Schafft 🦁

Cleanup: Removed tailing spaces

parent e9a90f99
...@@ -161,7 +161,7 @@ acl_t * acl_new_from_xml_node(xmlNodePtr node) { ...@@ -161,7 +161,7 @@ acl_t * acl_new_from_xml_node(xmlNodePtr node) {
} else if (strcmp((const char*)prop->name, "deny-all") == 0) { } else if (strcmp((const char*)prop->name, "deny-all") == 0) {
if (strstr(tmp, "*") || util_str_to_bool(tmp)) { if (strstr(tmp, "*") || util_str_to_bool(tmp)) {
acl_set_method_str(ret, ACL_POLICY_DENY, "*"); acl_set_method_str(ret, ACL_POLICY_DENY, "*");
acl_set_admin_str(ret, ACL_POLICY_DENY, "*"); acl_set_admin_str(ret, ACL_POLICY_DENY, "*");
acl_set_web_policy(ret, ACL_POLICY_DENY); acl_set_web_policy(ret, ACL_POLICY_DENY);
} else { } else {
acl_set_method_str(ret, ACL_POLICY_ALLOW, "*"); acl_set_method_str(ret, ACL_POLICY_ALLOW, "*");
...@@ -307,7 +307,7 @@ int acl_set_max_connection_duration(acl_t * acl, time_t duration) { ...@@ -307,7 +307,7 @@ int acl_set_max_connection_duration(acl_t * acl, time_t duration) {
time_t acl_get_max_connection_duration(acl_t * acl) { time_t acl_get_max_connection_duration(acl_t * acl) {
if (!acl) if (!acl)
return -1; return -1;
return acl->max_connection_duration; return acl->max_connection_duration;
} }
...@@ -323,6 +323,6 @@ int acl_set_max_connections_per_user(acl_t * acl, size_t limit) { ...@@ -323,6 +323,6 @@ int acl_set_max_connections_per_user(acl_t * acl, size_t limit) {
ssize_t acl_get_max_connections_per_user(acl_t * acl) { ssize_t acl_get_max_connections_per_user(acl_t * acl) {
if (!acl) if (!acl)
return -1; return -1;
return acl->max_connections_per_user; return acl->max_connections_per_user;
} }
...@@ -264,13 +264,13 @@ xmlDocPtr admin_build_sourcelist (const char *mount) ...@@ -264,13 +264,13 @@ xmlDocPtr admin_build_sourcelist (const char *mount)
if (source->running) if (source->running)
{ {
if (source->client) if (source->client)
{ {
snprintf (buf, sizeof(buf), "%lu", snprintf (buf, sizeof(buf), "%lu",
(unsigned long)(now - source->con->con_time)); (unsigned long)(now - source->con->con_time));
xmlNewChild (srcnode, NULL, XMLSTR("Connected"), XMLSTR(buf)); xmlNewChild (srcnode, NULL, XMLSTR("Connected"), XMLSTR(buf));
} }
xmlNewChild (srcnode, NULL, XMLSTR("content-type"), xmlNewChild (srcnode, NULL, XMLSTR("content-type"),
XMLSTR(source->format->contenttype)); XMLSTR(source->format->contenttype));
} }
} }
...@@ -330,7 +330,7 @@ void admin_send_response (xmlDocPtr doc, client_t *client, ...@@ -330,7 +330,7 @@ void admin_send_response (xmlDocPtr doc, client_t *client,
client_send_error(client, 500, 0, "Buffer reallocation failed."); client_send_error(client, 500, 0, "Buffer reallocation failed.");
xmlFree(buff); xmlFree(buff);
return; return;
} }
} }
/* FIXME: in this section we hope no function will ever return -1 */ /* FIXME: in this section we hope no function will ever return -1 */
...@@ -347,7 +347,7 @@ void admin_send_response (xmlDocPtr doc, client_t *client, ...@@ -347,7 +347,7 @@ void admin_send_response (xmlDocPtr doc, client_t *client,
int fullpath_xslt_template_len; int fullpath_xslt_template_len;
ice_config_t *config = config_get_config(); ice_config_t *config = config_get_config();
fullpath_xslt_template_len = strlen (config->adminroot_dir) + fullpath_xslt_template_len = strlen (config->adminroot_dir) +
strlen (xslt_template) + 2; strlen (xslt_template) + 2;
fullpath_xslt_template = malloc(fullpath_xslt_template_len); fullpath_xslt_template = malloc(fullpath_xslt_template_len);
snprintf(fullpath_xslt_template, fullpath_xslt_template_len, "%s%s%s", snprintf(fullpath_xslt_template, fullpath_xslt_template_len, "%s%s%s",
...@@ -417,7 +417,7 @@ void admin_handle_request(client_t *client, const char *uri) ...@@ -417,7 +417,7 @@ void admin_handle_request(client_t *client, const char *uri)
if (source == NULL) if (source == NULL)
{ {
ICECAST_LOG_WARN("Admin command %s on non-existent source %s", ICECAST_LOG_WARN("Admin command %s on non-existent source %s",
command_string, mount); command_string, mount);
avl_tree_unlock(global.source_tree); avl_tree_unlock(global.source_tree);
client_send_error(client, 400, 0, "Source does not exist"); client_send_error(client, 400, 0, "Source does not exist");
...@@ -441,7 +441,7 @@ void admin_handle_request(client_t *client, const char *uri) ...@@ -441,7 +441,7 @@ void admin_handle_request(client_t *client, const char *uri)
client_send_error(client, 400, 0, "illegal metadata call"); client_send_error(client, 400, 0, "illegal metadata call");
return; return;
} }
ICECAST_LOG_INFO("Received admin command %s on mount \"%s\"", ICECAST_LOG_INFO("Received admin command %s on mount \"%s\"",
command_string, mount); command_string, mount);
admin_handle_mount_request(client, source); admin_handle_mount_request(client, source);
avl_tree_unlock(global.source_tree); avl_tree_unlock(global.source_tree);
...@@ -611,7 +611,7 @@ static void command_move_clients(client_t *client, source_t *source, ...@@ -611,7 +611,7 @@ static void command_move_clients(client_t *client, source_t *source,
ICECAST_LOG_DEBUG("Done optional check (%d)", parameters_passed); ICECAST_LOG_DEBUG("Done optional check (%d)", parameters_passed);
if (!parameters_passed) { if (!parameters_passed) {
doc = admin_build_sourcelist(source->mount); doc = admin_build_sourcelist(source->mount);
admin_send_response(doc, client, response, admin_send_response(doc, client, response,
MOVECLIENTS_TRANSFORMED_REQUEST); MOVECLIENTS_TRANSFORMED_REQUEST);
xmlFreeDoc(doc); xmlFreeDoc(doc);
return; return;
...@@ -651,7 +651,7 @@ static void command_move_clients(client_t *client, source_t *source, ...@@ -651,7 +651,7 @@ static void command_move_clients(client_t *client, source_t *source,
xmlNewChild(node, NULL, XMLSTR("message"), XMLSTR(buf)); xmlNewChild(node, NULL, XMLSTR("message"), XMLSTR(buf));
xmlNewChild(node, NULL, XMLSTR("return"), XMLSTR("1")); xmlNewChild(node, NULL, XMLSTR("return"), XMLSTR("1"));
admin_send_response(doc, client, response, admin_send_response(doc, client, response,
ADMIN_XSL_RESPONSE); ADMIN_XSL_RESPONSE);
xmlFreeDoc(doc); xmlFreeDoc(doc);
} }
...@@ -731,7 +731,7 @@ static void command_show_listeners(client_t *client, source_t *source, ...@@ -731,7 +731,7 @@ static void command_show_listeners(client_t *client, source_t *source,
admin_add_listeners_to_mount(source, srcnode, client->mode); admin_add_listeners_to_mount(source, srcnode, client->mode);
admin_send_response(doc, client, response, admin_send_response(doc, client, response,
LISTCLIENTS_TRANSFORMED_REQUEST); LISTCLIENTS_TRANSFORMED_REQUEST);
xmlFreeDoc(doc); xmlFreeDoc(doc);
} }
...@@ -908,7 +908,7 @@ static void command_manageauth(client_t *client, int response) { ...@@ -908,7 +908,7 @@ static void command_manageauth(client_t *client, int response) {
config_release_config(); config_release_config();
auth_release(auth); auth_release(auth);
admin_send_response(doc, client, response, admin_send_response(doc, client, response,
MANAGEAUTH_TRANSFORMED_REQUEST); MANAGEAUTH_TRANSFORMED_REQUEST);
free (message); free (message);
xmlFreeDoc(doc); xmlFreeDoc(doc);
...@@ -978,7 +978,7 @@ static void command_kill_client(client_t *client, source_t *source, ...@@ -978,7 +978,7 @@ static void command_kill_client(client_t *client, source_t *source,
xmlNewChild(node, NULL, XMLSTR("message"), XMLSTR(buf)); xmlNewChild(node, NULL, XMLSTR("message"), XMLSTR(buf));
xmlNewChild(node, NULL, XMLSTR("return"), XMLSTR("0")); xmlNewChild(node, NULL, XMLSTR("return"), XMLSTR("0"));
} }
admin_send_response(doc, client, response, admin_send_response(doc, client, response,
ADMIN_XSL_RESPONSE); ADMIN_XSL_RESPONSE);
xmlFreeDoc(doc); xmlFreeDoc(doc);
} }
...@@ -1030,7 +1030,7 @@ static void command_metadata(client_t *client, source_t *source, ...@@ -1030,7 +1030,7 @@ static void command_metadata(client_t *client, source_t *source,
{ {
xmlNewChild(node, NULL, XMLSTR("message"), XMLSTR("No such action")); xmlNewChild(node, NULL, XMLSTR("message"), XMLSTR("No such action"));
xmlNewChild(node, NULL, XMLSTR("return"), XMLSTR("0")); xmlNewChild(node, NULL, XMLSTR("return"), XMLSTR("0"));
admin_send_response(doc, client, response, admin_send_response(doc, client, response,
ADMIN_XSL_RESPONSE); ADMIN_XSL_RESPONSE);
xmlFreeDoc(doc); xmlFreeDoc(doc);
return; return;
...@@ -1063,10 +1063,10 @@ static void command_metadata(client_t *client, source_t *source, ...@@ -1063,10 +1063,10 @@ static void command_metadata(client_t *client, source_t *source,
} }
else else
{ {
xmlNewChild(node, NULL, XMLSTR("message"), xmlNewChild(node, NULL, XMLSTR("message"),
XMLSTR("Mountpoint will not accept URL updates")); XMLSTR("Mountpoint will not accept URL updates"));
xmlNewChild(node, NULL, XMLSTR("return"), XMLSTR("1")); xmlNewChild(node, NULL, XMLSTR("return"), XMLSTR("1"));
admin_send_response(doc, client, response, admin_send_response(doc, client, response,
ADMIN_XSL_RESPONSE); ADMIN_XSL_RESPONSE);
xmlFreeDoc(doc); xmlFreeDoc(doc);
return; return;
...@@ -1074,7 +1074,7 @@ static void command_metadata(client_t *client, source_t *source, ...@@ -1074,7 +1074,7 @@ static void command_metadata(client_t *client, source_t *source,
xmlNewChild(node, NULL, XMLSTR("message"), XMLSTR("Metadata update successful")); xmlNewChild(node, NULL, XMLSTR("message"), XMLSTR("Metadata update successful"));
xmlNewChild(node, NULL, XMLSTR("return"), XMLSTR("1")); xmlNewChild(node, NULL, XMLSTR("return"), XMLSTR("1"));
admin_send_response(doc, client, response, admin_send_response(doc, client, response,
ADMIN_XSL_RESPONSE); ADMIN_XSL_RESPONSE);
xmlFreeDoc(doc); xmlFreeDoc(doc);
} }
...@@ -1108,7 +1108,7 @@ static void command_shoutcast_metadata(client_t *client, source_t *source) ...@@ -1108,7 +1108,7 @@ static void command_shoutcast_metadata(client_t *client, source_t *source)
source->format->set_tag (source->format, "title", value, NULL); source->format->set_tag (source->format, "title", value, NULL);
source->format->set_tag (source->format, NULL, NULL, NULL); source->format->set_tag (source->format, NULL, NULL, NULL);
ICECAST_LOG_DEBUG("Metadata on mountpoint %s changed to \"%s\"", ICECAST_LOG_DEBUG("Metadata on mountpoint %s changed to \"%s\"",
source->mount, value); source->mount, value);
html_success(client, "Metadata update successful"); html_success(client, "Metadata update successful");
} }
...@@ -1145,7 +1145,7 @@ static void command_queue_reload(client_t *client, int response) { ...@@ -1145,7 +1145,7 @@ static void command_queue_reload(client_t *client, int response) {
admin_send_response(doc, client, response, ADMIN_XSL_RESPONSE); admin_send_response(doc, client, response, ADMIN_XSL_RESPONSE);
xmlFreeDoc(doc); xmlFreeDoc(doc);
} }
static void command_list_mounts(client_t *client, int response) static void command_list_mounts(client_t *client, int response)
...@@ -1178,7 +1178,7 @@ static void command_list_mounts(client_t *client, int response) ...@@ -1178,7 +1178,7 @@ static void command_list_mounts(client_t *client, int response)
doc = admin_build_sourcelist(NULL); doc = admin_build_sourcelist(NULL);
avl_tree_unlock (global.source_tree); avl_tree_unlock (global.source_tree);
admin_send_response(doc, client, response, admin_send_response(doc, client, response,
LISTMOUNTS_TRANSFORMED_REQUEST); LISTMOUNTS_TRANSFORMED_REQUEST);
xmlFreeDoc(doc); xmlFreeDoc(doc);
} }
...@@ -1196,7 +1196,7 @@ static void command_updatemetadata(client_t *client, source_t *source, ...@@ -1196,7 +1196,7 @@ static void command_updatemetadata(client_t *client, source_t *source,
xmlSetProp (srcnode, XMLSTR("mount"), XMLSTR(source->mount)); xmlSetProp (srcnode, XMLSTR("mount"), XMLSTR(source->mount));
xmlDocSetRootElement(doc, node); xmlDocSetRootElement(doc, node);
admin_send_response(doc, client, response, admin_send_response(doc, client, response,
UPDATEMETADATA_TRANSFORMED_REQUEST); UPDATEMETADATA_TRANSFORMED_REQUEST);
xmlFreeDoc(doc); xmlFreeDoc(doc);
} }
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* This program is distributed under the GNU General Public License, version 2. * This program is distributed under the GNU General Public License, version 2.
* A copy of this license is included with this source. * A copy of this license is included with this source.
* *
* Copyright 2000-2004, Jack Moffitt <jack@xiph.org, * Copyright 2000-2004, Jack Moffitt <jack@xiph.org,
* Michael Smith <msmith@xiph.org>, * Michael Smith <msmith@xiph.org>,
* oddsock <oddsock@xiph.org>, * oddsock <oddsock@xiph.org>,
* Karl Heyes <karl@xiph.org> * Karl Heyes <karl@xiph.org>
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
* Copyright 2013-2014, Philipp "ph3-der-loewe" Schafft <lion@lion.leolix.org>, * Copyright 2013-2014, Philipp "ph3-der-loewe" Schafft <lion@lion.leolix.org>,
*/ */
/** /**
* Client authentication functions * Client authentication functions
*/ */
...@@ -89,7 +89,7 @@ static auth_client *auth_client_setup (client_t *client) ...@@ -89,7 +89,7 @@ static auth_client *auth_client_setup (client_t *client)
} }
tmp = strchr(userpass, ':'); tmp = strchr(userpass, ':');
if (tmp == NULL) { if (tmp == NULL) {
free(userpass); free(userpass);
break; break;
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* Copyright 2014, Philipp "ph3-der-loewe" Schafft <lion@lion.leolix.org>, * Copyright 2014, Philipp "ph3-der-loewe" Schafft <lion@lion.leolix.org>,
*/ */
/** /**
* Client authentication functions * Client authentication functions
*/ */
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* This program is distributed under the GNU General Public License, version 2. * This program is distributed under the GNU General Public License, version 2.
* A copy of this license is included with this source. * A copy of this license is included with this source.
* *
* Copyright 2000-2004, Jack Moffitt <jack@xiph.org, * Copyright 2000-2004, Jack Moffitt <jack@xiph.org,
* Michael Smith <msmith@xiph.org>, * Michael Smith <msmith@xiph.org>,
* oddsock <oddsock@xiph.org>, * oddsock <oddsock@xiph.org>,
* Karl Heyes <karl@xiph.org> * Karl Heyes <karl@xiph.org>
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
* Copyright 2012-2014, Philipp "ph3-der-loewe" Schafft <lion@lion.leolix.org>, * Copyright 2012-2014, Philipp "ph3-der-loewe" Schafft <lion@lion.leolix.org>,
*/ */
/** /**
* Client authentication functions * Client authentication functions
*/ */
...@@ -136,7 +136,7 @@ static void htpasswd_recheckfile (htpasswd_auth_state *htpasswd) ...@@ -136,7 +136,7 @@ static void htpasswd_recheckfile (htpasswd_auth_state *htpasswd)
passwdfile = fopen (htpasswd->filename, "rb"); passwdfile = fopen (htpasswd->filename, "rb");
if (passwdfile == NULL) if (passwdfile == NULL)
{ {
ICECAST_LOG_WARN("Failed to open authentication database \"%s\": %s", ICECAST_LOG_WARN("Failed to open authentication database \"%s\": %s",
htpasswd->filename, strerror(errno)); htpasswd->filename, strerror(errno));
return; return;
} }
...@@ -240,7 +240,7 @@ int auth_get_htpasswd_auth (auth_t *authenticator, config_options_t *options) ...@@ -240,7 +240,7 @@ int auth_get_htpasswd_auth (auth_t *authenticator, config_options_t *options)
} }
if (state->filename) if (state->filename)
ICECAST_LOG_INFO("Configured htpasswd authentication using password file \"%s\"", ICECAST_LOG_INFO("Configured htpasswd authentication using password file \"%s\"",
state->filename); state->filename);
else else
ICECAST_LOG_ERROR("No filename given in options for authenticator."); ICECAST_LOG_ERROR("No filename given in options for authenticator.");
...@@ -278,7 +278,7 @@ static auth_result htpasswd_adduser (auth_t *auth, const char *username, const c ...@@ -278,7 +278,7 @@ static auth_result htpasswd_adduser (auth_t *auth, const char *username, const c
if (passwdfile == NULL) if (passwdfile == NULL)
{ {
thread_rwlock_unlock (&state->file_rwlock); thread_rwlock_unlock (&state->file_rwlock);
ICECAST_LOG_WARN("Failed to open authentication database \"%s\": %s", ICECAST_LOG_WARN("Failed to open authentication database \"%s\": %s",
state->filename, strerror(errno)); state->filename, strerror(errno));
return AUTH_FAILED; return AUTH_FAILED;
} }
...@@ -312,7 +312,7 @@ static auth_result htpasswd_deleteuser(auth_t *auth, const char *username) ...@@ -312,7 +312,7 @@ static auth_result htpasswd_deleteuser(auth_t *auth, const char *username)
passwdfile = fopen(state->filename, "rb"); passwdfile = fopen(state->filename, "rb");
if(passwdfile == NULL) { if(passwdfile == NULL) {
ICECAST_LOG_WARN("Failed to open authentication database \"%s\": %s", ICECAST_LOG_WARN("Failed to open authentication database \"%s\": %s",
state->filename, strerror(errno)); state->filename, strerror(errno));
thread_rwlock_unlock (&state->file_rwlock); thread_rwlock_unlock (&state->file_rwlock);
return AUTH_FAILED; return AUTH_FAILED;
...@@ -332,7 +332,7 @@ static auth_result htpasswd_deleteuser(auth_t *auth, const char *username) ...@@ -332,7 +332,7 @@ static auth_result htpasswd_deleteuser(auth_t *auth, const char *username)
tmp_passwdfile = fopen(tmpfile, "wb"); tmp_passwdfile = fopen(tmpfile, "wb");
if(tmp_passwdfile == NULL) { if(tmp_passwdfile == NULL) {
ICECAST_LOG_WARN("Failed to open temporary authentication database \"%s\": %s", ICECAST_LOG_WARN("Failed to open temporary authentication database \"%s\": %s",
tmpfile, strerror(errno)); tmpfile, strerror(errno));
fclose(passwdfile); fclose(passwdfile);
free(tmpfile); free(tmpfile);
...@@ -367,12 +367,12 @@ static auth_result htpasswd_deleteuser(auth_t *auth, const char *username) ...@@ -367,12 +367,12 @@ static auth_result htpasswd_deleteuser(auth_t *auth, const char *username)
/* Windows won't let us rename a file if the destination file /* Windows won't let us rename a file if the destination file
exists...so, lets remove the original first */ exists...so, lets remove the original first */
if (remove(state->filename) != 0) { if (remove(state->filename) != 0) {
ICECAST_LOG_ERROR("Problem moving temp authentication file to original \"%s\" - \"%s\": %s", ICECAST_LOG_ERROR("Problem moving temp authentication file to original \"%s\" - \"%s\": %s",
tmpfile, state->filename, strerror(errno)); tmpfile, state->filename, strerror(errno));
} }
else { else {
if (rename(tmpfile, state->filename) != 0) { if (rename(tmpfile, state->filename) != 0) {
ICECAST_LOG_ERROR("Problem moving temp authentication file to original \"%s\" - \"%s\": %s", ICECAST_LOG_ERROR("Problem moving temp authentication file to original \"%s\" - \"%s\": %s",
tmpfile, state->filename, strerror(errno)); tmpfile, state->filename, strerror(errno));
} }
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* Copyright 2014, Philipp "ph3-der-loewe" Schafft <lion@lion.leolix.org>, * Copyright 2014, Philipp "ph3-der-loewe" Schafft <lion@lion.leolix.org>,
*/ */
/** /**
* Client authentication functions * Client authentication functions
*/ */
......
...@@ -30,10 +30,10 @@ ...@@ -30,10 +30,10 @@
#include "cfgfile.h" #include "cfgfile.h"
#include "refbuf.h" #include "refbuf.h"
#include "client.h" #include "client.h"
#include "logging.h" #include "logging.h"
#include "util.h" #include "util.h"
#include "auth.h" #include "auth.h"
#include "event.h" #include "event.h"
/* for config_reread_config() */ /* for config_reread_config() */
#include "yp.h" #include "yp.h"
...@@ -94,13 +94,13 @@ static void _parse_directory(xmlDocPtr doc, xmlNodePtr node, ice_config_t *c); ...@@ -94,13 +94,13 @@ static void _parse_directory(xmlDocPtr doc, xmlNodePtr node, ice_config_t *c);
static void _parse_paths(xmlDocPtr doc, xmlNodePtr node, ice_config_t *c); static void _parse_paths(xmlDocPtr doc, xmlNodePtr node, ice_config_t *c);
static void _parse_logging(xmlDocPtr doc, xmlNodePtr node, ice_config_t *c); static void _parse_logging(xmlDocPtr doc, xmlNodePtr node, ice_config_t *c);
static void _parse_security(xmlDocPtr doc, xmlNodePtr node, ice_config_t *c); static void _parse_security(xmlDocPtr doc, xmlNodePtr node, ice_config_t *c);
static void _parse_authentication(xmlDocPtr doc, xmlNodePtr node, static void _parse_authentication(xmlDocPtr doc, xmlNodePtr node,
ice_config_t *c, char **source_password); ice_config_t *c, char **source_password);
static void _parse_http_headers(xmlDocPtr doc, xmlNodePtr node, static void _parse_http_headers(xmlDocPtr doc, xmlNodePtr node,
ice_config_http_header_t **http_headers); ice_config_http_header_t **http_headers);
static void _parse_relay(xmlDocPtr doc, xmlNodePtr node, ice_config_t *c); static void _parse_relay(xmlDocPtr doc, xmlNodePtr node, ice_config_t *c);
static void _parse_mount(xmlDocPtr doc, xmlNodePtr node, ice_config_t *c); static void _parse_mount(xmlDocPtr doc, xmlNodePtr node, ice_config_t *c);
static void _parse_listen_socket(xmlDocPtr doc, xmlNodePtr node, static void _parse_listen_socket(xmlDocPtr doc, xmlNodePtr node,
ice_config_t *c); ice_config_t *c);
static void _add_server(xmlDocPtr doc, xmlNodePtr node, ice_config_t *c); static void _add_server(xmlDocPtr doc, xmlNodePtr node, ice_config_t *c);
static void _parse_events(event_registration_t **events, xmlNodePtr node); static void _parse_events(event_registration_t **events, xmlNodePtr node);
...@@ -549,7 +549,7 @@ int config_parse_file(const char *filename, ice_config_t *configuration) ...@@ -549,7 +549,7 @@ int config_parse_file(const char *filename, ice_config_t *configuration)
xmlNodePtr node; xmlNodePtr node;
if (filename == NULL || strcmp(filename, "") == 0) return CONFIG_EINSANE; if (filename == NULL || strcmp(filename, "") == 0) return CONFIG_EINSANE;
doc = xmlParseFile(filename); doc = xmlParseFile(filename);
if (doc == NULL) { if (doc == NULL) {
return CONFIG_EPARSE; return CONFIG_EPARSE;
...@@ -696,7 +696,7 @@ static inline void __check_hostname(ice_config_t *configuration) { ...@@ -696,7 +696,7 @@ static inline void __check_hostname(ice_config_t *configuration) {
} }
} }
static void _parse_root(xmlDocPtr doc, xmlNodePtr node, static void _parse_root(xmlDocPtr doc, xmlNodePtr node,
ice_config_t *configuration) ice_config_t *configuration)
{ {
char *tmp; char *tmp;
...@@ -756,7 +756,7 @@ static void _parse_root(xmlDocPtr doc, xmlNodePtr node, ...@@ -756,7 +756,7 @@ static void _parse_root(xmlDocPtr doc, xmlNodePtr node,
ICECAST_LOG_WARN("<port> must not be empty."); ICECAST_LOG_WARN("<port> must not be empty.");
} }
} else if (xmlStrcmp (node->name, XMLSTR("bind-address")) == 0) { } else if (xmlStrcmp (node->name, XMLSTR("bind-address")) == 0) {
if (configuration->listen_sock->bind_address) if (configuration->listen_sock->bind_address)
xmlFree(configuration->listen_sock->bind_address); xmlFree(configuration->listen_sock->bind_address);
configuration->listen_sock->bind_address = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1); configuration->listen_sock->bind_address = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
} else if (xmlStrcmp (node->name, XMLSTR("master-server")) == 0) { } else if (xmlStrcmp (node->name, XMLSTR("master-server")) == 0) {
...@@ -854,7 +854,7 @@ static void _parse_root(xmlDocPtr doc, xmlNodePtr node, ...@@ -854,7 +854,7 @@ static void _parse_root(xmlDocPtr doc, xmlNodePtr node,
} }
} }
static void _parse_limits(xmlDocPtr doc, xmlNodePtr node, static void _parse_limits(xmlDocPtr doc, xmlNodePtr node,
ice_config_t *configuration) ice_config_t *configuration)
{ {
char *tmp; char *tmp;
...@@ -1058,7 +1058,7 @@ static void _parse_mount_oldstyle_authentication(mount_proxy *mount, xmlNodePtr ...@@ -1058,7 +1058,7 @@ static void _parse_mount_oldstyle_authentication(mount_proxy *mount, xmlNodePtr
xmlFree(type); xmlFree(type);
} }
static void _parse_mount(xmlDocPtr doc, xmlNodePtr node, static void _parse_mount(xmlDocPtr doc, xmlNodePtr node,
ice_config_t *configuration) ice_config_t *configuration)
{ {
char *tmp; char *tmp;
...@@ -1068,7 +1068,7 @@ static void _parse_mount(xmlDocPtr doc, xmlNodePtr node, ...@@ -1068,7 +1068,7 @@ static void _parse_mount(xmlDocPtr doc, xmlNodePtr node,
char *username = NULL; char *username = NULL;
char *password = NULL; char *password = NULL;
auth_stack_t *authstack = NULL; auth_stack_t *authstack = NULL;
/* default <mount> settings */ /* default <mount> settings */
mount->mounttype = MOUNT_TYPE_NORMAL; mount->mounttype = MOUNT_TYPE_NORMAL;
mount->max_listeners = -1; mount->max_listeners = -1;
...@@ -1487,12 +1487,12 @@ static void _parse_listen_socket(xmlDocPtr doc, xmlNodePtr node, ...@@ -1487,12 +1487,12 @@ static void _parse_listen_socket(xmlDocPtr doc, xmlNodePtr node,
} }
else if (xmlStrcmp (node->name, XMLSTR("shoutcast-mount")) == 0) { else if (xmlStrcmp (node->name, XMLSTR("shoutcast-mount")) == 0) {
if (listener->shoutcast_mount) xmlFree (listener->shoutcast_mount); if (listener->shoutcast_mount) xmlFree (listener->shoutcast_mount);
listener->shoutcast_mount = (char *)xmlNodeListGetString(doc, listener->shoutcast_mount = (char *)xmlNodeListGetString(doc,
node->xmlChildrenNode, 1); node->xmlChildrenNode, 1);
} }
else if (xmlStrcmp (node->name, XMLSTR("bind-address")) == 0) { else if (xmlStrcmp (node->name, XMLSTR("bind-address")) == 0) {
if (listener->bind_address) xmlFree (listener->bind_address); if (listener->bind_address) xmlFree (listener->bind_address);
listener->bind_address = (char *)xmlNodeListGetString(doc, listener->bind_address = (char *)xmlNodeListGetString(doc,
node->xmlChildrenNode, 1); node->xmlChildrenNode, 1);
} }
else if (xmlStrcmp (node->name, XMLSTR("so-sndbuf")) == 0) { else if (xmlStrcmp (node->name, XMLSTR("so-sndbuf")) == 0) {
...@@ -1540,7 +1540,7 @@ static void _parse_authentication(xmlDocPtr doc, xmlNodePtr node, ...@@ -1540,7 +1540,7 @@ static void _parse_authentication(xmlDocPtr doc, xmlNodePtr node,
} }
else { else {
if (*source_password) xmlFree(*source_password); if (*source_password) xmlFree(*source_password);
*source_password = *source_password =
(char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1); (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
} }
} else if (xmlStrcmp (node->name, XMLSTR("admin-password")) == 0) { } else if (xmlStrcmp (node->name, XMLSTR("admin-password")) == 0) {
...@@ -1608,13 +1608,13 @@ static void _parse_directory(xmlDocPtr doc, xmlNodePtr node, ...@@ -1608,13 +1608,13 @@ static void _parse_directory(xmlDocPtr doc, xmlNodePtr node,
if (xmlIsBlankNode(node)) continue; if (xmlIsBlankNode(node)) continue;
if (xmlStrcmp (node->name, XMLSTR("yp-url")) == 0) { if (xmlStrcmp (node->name, XMLSTR("yp-url")) == 0) {
if (configuration->yp_url[configuration->num_yp_directories]) if (configuration->yp_url[configuration->num_yp_directories])
xmlFree(configuration->yp_url[configuration->num_yp_directories]); xmlFree(configuration->yp_url[configuration->num_yp_directories]);
configuration->yp_url[configuration->num_yp_directories] = configuration->yp_url[configuration->num_yp_directories] =
(char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1); (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
} else if (xmlStrcmp (node->name, XMLSTR("yp-url-timeout")) == 0) { } else if (xmlStrcmp (node->name, XMLSTR("yp-url-timeout")) == 0) {