Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
spr0cketeer
Icecast-Server
Commits
11d5dffd
Commit
11d5dffd
authored
Jan 10, 2015
by
Philipp Schafft
🦁
Browse files
Cleanup: Removed tailing spaces
parent
e9a90f99
Changes
34
Hide whitespace changes
Inline
Side-by-side
src/acl.c
View file @
11d5dffd
...
...
@@ -161,7 +161,7 @@ acl_t * acl_new_from_xml_node(xmlNodePtr node) {
}
else
if
(
strcmp
((
const
char
*
)
prop
->
name
,
"deny-all"
)
==
0
)
{
if
(
strstr
(
tmp
,
"*"
)
||
util_str_to_bool
(
tmp
))
{
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
);
}
else
{
acl_set_method_str
(
ret
,
ACL_POLICY_ALLOW
,
"*"
);
...
...
@@ -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
)
{
if
(
!
acl
)
return
-
1
;
return
acl
->
max_connection_duration
;
}
...
...
@@ -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
)
{
if
(
!
acl
)
return
-
1
;
return
acl
->
max_connections_per_user
;
}
src/admin.c
View file @
11d5dffd
...
...
@@ -264,13 +264,13 @@ xmlDocPtr admin_build_sourcelist (const char *mount)
if
(
source
->
running
)
{
if
(
source
->
client
)
if
(
source
->
client
)
{
snprintf
(
buf
,
sizeof
(
buf
),
"%lu"
,
(
unsigned
long
)(
now
-
source
->
con
->
con_time
));
xmlNewChild
(
srcnode
,
NULL
,
XMLSTR
(
"Connected"
),
XMLSTR
(
buf
));
}
xmlNewChild
(
srcnode
,
NULL
,
XMLSTR
(
"content-type"
),
xmlNewChild
(
srcnode
,
NULL
,
XMLSTR
(
"content-type"
),
XMLSTR
(
source
->
format
->
contenttype
));
}
}
...
...
@@ -330,7 +330,7 @@ void admin_send_response (xmlDocPtr doc, client_t *client,
client_send_error
(
client
,
500
,
0
,
"Buffer reallocation failed."
);
xmlFree
(
buff
);
return
;
}
}
}
/* 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,
int
fullpath_xslt_template_len
;
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
;
fullpath_xslt_template
=
malloc
(
fullpath_xslt_template_len
);
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)
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
);
avl_tree_unlock
(
global
.
source_tree
);
client_send_error
(
client
,
400
,
0
,
"Source does not exist"
);
...
...
@@ -441,7 +441,7 @@ void admin_handle_request(client_t *client, const char *uri)
client_send_error
(
client
,
400
,
0
,
"illegal metadata call"
);
return
;
}
ICECAST_LOG_INFO
(
"Received admin command %s on mount
\"
%s
\"
"
,
ICECAST_LOG_INFO
(
"Received admin command %s on mount
\"
%s
\"
"
,
command_string
,
mount
);
admin_handle_mount_request
(
client
,
source
);
avl_tree_unlock
(
global
.
source_tree
);
...
...
@@ -611,7 +611,7 @@ static void command_move_clients(client_t *client, source_t *source,
ICECAST_LOG_DEBUG
(
"Done optional check (%d)"
,
parameters_passed
);
if
(
!
parameters_passed
)
{
doc
=
admin_build_sourcelist
(
source
->
mount
);
admin_send_response
(
doc
,
client
,
response
,
admin_send_response
(
doc
,
client
,
response
,
MOVECLIENTS_TRANSFORMED_REQUEST
);
xmlFreeDoc
(
doc
);
return
;
...
...
@@ -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
(
"return"
),
XMLSTR
(
"1"
));
admin_send_response
(
doc
,
client
,
response
,
admin_send_response
(
doc
,
client
,
response
,
ADMIN_XSL_RESPONSE
);
xmlFreeDoc
(
doc
);
}
...
...
@@ -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_send_response
(
doc
,
client
,
response
,
admin_send_response
(
doc
,
client
,
response
,
LISTCLIENTS_TRANSFORMED_REQUEST
);
xmlFreeDoc
(
doc
);
}
...
...
@@ -908,7 +908,7 @@ static void command_manageauth(client_t *client, int response) {
config_release_config
();
auth_release
(
auth
);
admin_send_response
(
doc
,
client
,
response
,
admin_send_response
(
doc
,
client
,
response
,
MANAGEAUTH_TRANSFORMED_REQUEST
);
free
(
message
);
xmlFreeDoc
(
doc
);
...
...
@@ -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
(
"return"
),
XMLSTR
(
"0"
));
}
admin_send_response
(
doc
,
client
,
response
,
admin_send_response
(
doc
,
client
,
response
,
ADMIN_XSL_RESPONSE
);
xmlFreeDoc
(
doc
);
}
...
...
@@ -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
(
"return"
),
XMLSTR
(
"0"
));
admin_send_response
(
doc
,
client
,
response
,
admin_send_response
(
doc
,
client
,
response
,
ADMIN_XSL_RESPONSE
);
xmlFreeDoc
(
doc
);
return
;
...
...
@@ -1063,10 +1063,10 @@ static void command_metadata(client_t *client, source_t *source,
}
else
{
xmlNewChild
(
node
,
NULL
,
XMLSTR
(
"message"
),
xmlNewChild
(
node
,
NULL
,
XMLSTR
(
"message"
),
XMLSTR
(
"Mountpoint will not accept URL updates"
));
xmlNewChild
(
node
,
NULL
,
XMLSTR
(
"return"
),
XMLSTR
(
"1"
));
admin_send_response
(
doc
,
client
,
response
,
admin_send_response
(
doc
,
client
,
response
,
ADMIN_XSL_RESPONSE
);
xmlFreeDoc
(
doc
);
return
;
...
...
@@ -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
(
"return"
),
XMLSTR
(
"1"
));
admin_send_response
(
doc
,
client
,
response
,
admin_send_response
(
doc
,
client
,
response
,
ADMIN_XSL_RESPONSE
);
xmlFreeDoc
(
doc
);
}
...
...
@@ -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
,
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
);
html_success
(
client
,
"Metadata update successful"
);
}
...
...
@@ -1145,7 +1145,7 @@ static void command_queue_reload(client_t *client, int response) {
admin_send_response
(
doc
,
client
,
response
,
ADMIN_XSL_RESPONSE
);
xmlFreeDoc
(
doc
);
}
}
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
);
avl_tree_unlock
(
global
.
source_tree
);
admin_send_response
(
doc
,
client
,
response
,
admin_send_response
(
doc
,
client
,
response
,
LISTMOUNTS_TRANSFORMED_REQUEST
);
xmlFreeDoc
(
doc
);
}
...
...
@@ -1196,7 +1196,7 @@ static void command_updatemetadata(client_t *client, source_t *source,
xmlSetProp
(
srcnode
,
XMLSTR
(
"mount"
),
XMLSTR
(
source
->
mount
));
xmlDocSetRootElement
(
doc
,
node
);
admin_send_response
(
doc
,
client
,
response
,
admin_send_response
(
doc
,
client
,
response
,
UPDATEMETADATA_TRANSFORMED_REQUEST
);
xmlFreeDoc
(
doc
);
}
src/auth.c
View file @
11d5dffd
...
...
@@ -3,7 +3,7 @@
* This program is distributed under the GNU General Public License, version 2.
* 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>,
* oddsock <oddsock@xiph.org>,
* Karl Heyes <karl@xiph.org>
...
...
@@ -11,7 +11,7 @@
* Copyright 2013-2014, Philipp "ph3-der-loewe" Schafft <lion@lion.leolix.org>,
*/
/**
/**
* Client authentication functions
*/
...
...
@@ -89,7 +89,7 @@ static auth_client *auth_client_setup (client_t *client)
}
tmp
=
strchr
(
userpass
,
':'
);
if
(
tmp
==
NULL
)
{
if
(
tmp
==
NULL
)
{
free
(
userpass
);
break
;
}
...
...
src/auth_anonymous.c
View file @
11d5dffd
...
...
@@ -6,7 +6,7 @@
* Copyright 2014, Philipp "ph3-der-loewe" Schafft <lion@lion.leolix.org>,
*/
/**
/**
* Client authentication functions
*/
...
...
src/auth_htpasswd.c
View file @
11d5dffd
...
...
@@ -3,7 +3,7 @@
* This program is distributed under the GNU General Public License, version 2.
* 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>,
* oddsock <oddsock@xiph.org>,
* Karl Heyes <karl@xiph.org>
...
...
@@ -11,7 +11,7 @@
* Copyright 2012-2014, Philipp "ph3-der-loewe" Schafft <lion@lion.leolix.org>,
*/
/**
/**
* Client authentication functions
*/
...
...
@@ -136,7 +136,7 @@ static void htpasswd_recheckfile (htpasswd_auth_state *htpasswd)
passwdfile
=
fopen
(
htpasswd
->
filename
,
"rb"
);
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
));
return
;
}
...
...
@@ -240,7 +240,7 @@ int auth_get_htpasswd_auth (auth_t *authenticator, config_options_t *options)
}
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
);
else
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
if
(
passwdfile
==
NULL
)
{
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
));
return
AUTH_FAILED
;
}
...
...
@@ -312,7 +312,7 @@ static auth_result htpasswd_deleteuser(auth_t *auth, const char *username)
passwdfile
=
fopen
(
state
->
filename
,
"rb"
);
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
));
thread_rwlock_unlock
(
&
state
->
file_rwlock
);
return
AUTH_FAILED
;
...
...
@@ -332,7 +332,7 @@ static auth_result htpasswd_deleteuser(auth_t *auth, const char *username)
tmp_passwdfile
=
fopen
(
tmpfile
,
"wb"
);
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
));
fclose
(
passwdfile
);
free
(
tmpfile
);
...
...
@@ -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
exists...so, lets remove the original first */
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
));
}
else
{
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
));
}
}
...
...
src/auth_static.c
View file @
11d5dffd
...
...
@@ -6,7 +6,7 @@
* Copyright 2014, Philipp "ph3-der-loewe" Schafft <lion@lion.leolix.org>,
*/
/**
/**
* Client authentication functions
*/
...
...
src/cfgfile.c
View file @
11d5dffd
...
...
@@ -30,10 +30,10 @@
#include
"cfgfile.h"
#include
"refbuf.h"
#include
"client.h"
#include
"logging.h"
#include
"util.h"
#include
"auth.h"
#include
"event.h"
#include
"logging.h"
#include
"util.h"
#include
"auth.h"
#include
"event.h"
/* for config_reread_config() */
#include
"yp.h"
...
...
@@ -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_logging
(
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
);
static
void
_parse_http_headers
(
xmlDocPtr
doc
,
xmlNodePtr
node
,
ice_config_http_header_t
**
http_headers
);
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_listen_socket
(
xmlDocPtr
doc
,
xmlNodePtr
node
,
static
void
_parse_listen_socket
(
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
);
...
...
@@ -549,7 +549,7 @@ int config_parse_file(const char *filename, ice_config_t *configuration)
xmlNodePtr
node
;
if
(
filename
==
NULL
||
strcmp
(
filename
,
""
)
==
0
)
return
CONFIG_EINSANE
;
doc
=
xmlParseFile
(
filename
);
if
(
doc
==
NULL
)
{
return
CONFIG_EPARSE
;
...
...
@@ -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
)
{
char
*
tmp
;
...
...
@@ -756,7 +756,7 @@ static void _parse_root(xmlDocPtr doc, xmlNodePtr node,
ICECAST_LOG_WARN
(
"<port> must not be empty."
);
}
}
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
);
configuration
->
listen_sock
->
bind_address
=
(
char
*
)
xmlNodeListGetString
(
doc
,
node
->
xmlChildrenNode
,
1
);
}
else
if
(
xmlStrcmp
(
node
->
name
,
XMLSTR
(
"master-server"
))
==
0
)
{
...
...
@@ -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
)
{
char
*
tmp
;
...
...
@@ -1058,7 +1058,7 @@ static void _parse_mount_oldstyle_authentication(mount_proxy *mount, xmlNodePtr
xmlFree
(
type
);
}
static
void
_parse_mount
(
xmlDocPtr
doc
,
xmlNodePtr
node
,
static
void
_parse_mount
(
xmlDocPtr
doc
,
xmlNodePtr
node
,
ice_config_t
*
configuration
)
{
char
*
tmp
;
...
...
@@ -1068,7 +1068,7 @@ static void _parse_mount(xmlDocPtr doc, xmlNodePtr node,
char
*
username
=
NULL
;
char
*
password
=
NULL
;
auth_stack_t
*
authstack
=
NULL
;
/* default <mount> settings */
mount
->
mounttype
=
MOUNT_TYPE_NORMAL
;
mount
->
max_listeners
=
-
1
;
...
...
@@ -1487,12 +1487,12 @@ static void _parse_listen_socket(xmlDocPtr doc, xmlNodePtr node,
}
else
if
(
xmlStrcmp
(
node
->
name
,
XMLSTR
(
"shoutcast-mount"
))
==
0
)
{
if
(
listener
->
shoutcast_mount
)
xmlFree
(
listener
->
shoutcast_mount
);
listener
->
shoutcast_mount
=
(
char
*
)
xmlNodeListGetString
(
doc
,
listener
->
shoutcast_mount
=
(
char
*
)
xmlNodeListGetString
(
doc
,
node
->
xmlChildrenNode
,
1
);
}
else
if
(
xmlStrcmp
(
node
->
name
,
XMLSTR
(
"bind-address"
))
==
0
)
{
if
(
listener
->
bind_address
)
xmlFree
(
listener
->
bind_address
);
listener
->
bind_address
=
(
char
*
)
xmlNodeListGetString
(
doc
,
listener
->
bind_address
=
(
char
*
)
xmlNodeListGetString
(
doc
,
node
->
xmlChildrenNode
,
1
);
}
else
if
(
xmlStrcmp
(
node
->
name
,
XMLSTR
(
"so-sndbuf"
))
==
0
)
{
...
...
@@ -1540,7 +1540,7 @@ static void _parse_authentication(xmlDocPtr doc, xmlNodePtr node,
}
else
{
if
(
*
source_password
)
xmlFree
(
*
source_password
);
*
source_password
=
*
source_password
=
(
char
*
)
xmlNodeListGetString
(
doc
,
node
->
xmlChildrenNode
,
1
);
}
}
else
if
(
xmlStrcmp
(
node
->
name
,
XMLSTR
(
"admin-password"
))
==
0
)
{
...
...
@@ -1608,13 +1608,13 @@ static void _parse_directory(xmlDocPtr doc, xmlNodePtr node,
if
(
xmlIsBlankNode
(
node
))
continue
;
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
]);
configuration
->
yp_url
[
configuration
->
num_yp_directories
]
=
configuration
->
yp_url
[
configuration
->
num_yp_directories
]
=
(
char
*
)
xmlNodeListGetString
(
doc
,
node
->
xmlChildrenNode
,
1
);
}
else
if
(
xmlStrcmp
(
node
->
name
,
XMLSTR
(
"yp-url-timeout"
))
==
0
)
{
tmp
=
(
char
*
)
xmlNodeListGetString
(
doc
,
node
->
xmlChildrenNode
,
1
);
configuration
->
yp_url_timeout
[
configuration
->
num_yp_directories
]
=
configuration
->
yp_url_timeout
[
configuration
->
num_yp_directories
]
=
atoi
(
tmp
);
if
(
tmp
)
xmlFree
(
tmp
);
}
else
if
(
xmlStrcmp
(
node
->
name
,
XMLSTR
(
"server"
))
==
0
)
{
...
...
@@ -1683,7 +1683,7 @@ static void _parse_paths(xmlDocPtr doc, xmlNodePtr node,
ICECAST_LOG_WARN
(
"<adminroot> must not be empty."
);
continue
;
}
if
(
configuration
->
adminroot_dir
)
if
(
configuration
->
adminroot_dir
)
xmlFree
(
configuration
->
adminroot_dir
);
configuration
->
adminroot_dir
=
(
char
*
)
temp
;
if
(
configuration
->
adminroot_dir
[
strlen
(
configuration
->
adminroot_dir
)
-
1
]
==
'/'
)
...
...
@@ -1811,7 +1811,7 @@ static void _parse_security(xmlDocPtr doc, xmlNodePtr node,
}
while
((
node
=
node
->
next
));
}
static
void
_add_server
(
xmlDocPtr
doc
,
xmlNodePtr
node
,
static
void
_add_server
(
xmlDocPtr
doc
,
xmlNodePtr
node
,
ice_config_t
*
configuration
)
{
ice_config_dir_t
*
dirnode
,
*
server
;
...
...
@@ -1822,7 +1822,7 @@ static void _add_server(xmlDocPtr doc, xmlNodePtr node,
server
->
touch_interval
=
configuration
->
touch_interval
;
server
->
host
=
NULL
;
addnode
=
0
;
do
{
if
(
node
==
NULL
)
break
;
if
(
xmlIsBlankNode
(
node
))
continue
;
...
...
@@ -1845,10 +1845,10 @@ static void _add_server(xmlDocPtr doc, xmlNodePtr node,
configuration
->
dir_list
=
server
;
}
else
{
while
(
dirnode
->
next
)
dirnode
=
dirnode
->
next
;
dirnode
->
next
=
server
;
}
server
=
NULL
;
addnode
=
0
;
}
...
...
@@ -2033,7 +2033,7 @@ mount_proxy *config_find_mount (ice_config_t *config, const char *mount, mount_t
return
mountinfo
;
}
/* Helper function to locate the configuration details of the listening
/* Helper function to locate the configuration details of the listening
* socket
*/
listener_t
*
config_get_listen_sock
(
ice_config_t
*
config
,
connection_t
*
con
)
...
...
src/client.c
View file @
11d5dffd
...
...
@@ -3,7 +3,7 @@
* This program is distributed under the GNU General Public License, version 2.
* 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>,
* oddsock <oddsock@xiph.org>,
* Karl Heyes <karl@xiph.org>
...
...
@@ -108,7 +108,7 @@ void client_destroy(client_t *client)
if
(
auth_release_client
(
client
))
return
;
/* write log entry if ip is set (some things don't set it, like outgoing
/* write log entry if ip is set (some things don't set it, like outgoing
* slave requests
*/
if
(
client
->
respcode
&&
client
->
parser
)
...
...
src/configtest.c
View file @
11d5dffd
...
...
@@ -3,7 +3,7 @@
* This program is distributed under the GNU General Public License, version 2.
* 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>,
* oddsock <oddsock@xiph.org>,
* Karl Heyes <karl@xiph.org>
...
...
@@ -24,7 +24,7 @@ int main(void)
ice_config_t
*
config
;
config_initialize
();
config_parse_file
(
"icecast.xml"
);
config
=
config_get_config_unlocked
();
...
...
@@ -54,7 +54,7 @@ void _dump_config(ice_config_t *config)
while
(
node
)
{
printf
(
"directory.touch_interval = %d
\n
"
,
node
->
touch_interval
);
printf
(
"directory.host = %s
\n
"
,
node
->
host
);
node
=
node
->
next
;
}
...
...
src/connection.c
View file @
11d5dffd
...
...
@@ -3,7 +3,7 @@
* This program is distributed under the GNU General Public License, version 2.
* 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>,
* oddsock <oddsock@xiph.org>,
* Karl Heyes <karl@xiph.org>
...
...
@@ -136,7 +136,7 @@ static int free_filtered_ip (void*x)
void
connection_initialize
(
void
)
{
if
(
_initialized
)
return
;
thread_spin_create
(
&
_connection_lock
);
thread_mutex_create
(
&
move_clients_mutex
);
thread_rwlock_create
(
&
_source_shutdown_rwlock
);
...
...
@@ -158,13 +158,13 @@ void connection_initialize(void)
void
connection_shutdown
(
void
)
{
if
(
!
_initialized
)
return
;
#ifdef HAVE_OPENSSL
SSL_CTX_free
(
ssl_ctx
);
#endif
if
(
banned_ip
.
contents
)
avl_tree_free
(
banned_ip
.
contents
,
free_filtered_ip
);
if
(
allowed_ip
.
contents
)
avl_tree_free
(
allowed_ip
.
contents
,
free_filtered_ip
);
thread_cond_destroy
(
&
global
.
shutdown_cond
);
thread_rwlock_destroy
(
&
_source_shutdown_rwlock
);
thread_spin_destroy
(
&
_connection_lock
);
...
...
@@ -223,13 +223,13 @@ static void get_ssl_certificate (ice_config_t *config)
ICECAST_LOG_ERROR
(
"Invalid %s - Private key does not match cert public key"
,
config
->
cert_file
);
break
;
}
if
(
SSL_CTX_set_cipher_list
(
ssl_ctx
,
config
->
cipher_list
)
<=
0
)
{
ICECAST_LOG_WARN
(
"Invalid cipher list: %s"
,
config
->
cipher_list
);
}
if
(
SSL_CTX_set_cipher_list
(
ssl_ctx
,
config
->
cipher_list
)
<=
0
)
{
ICECAST_LOG_WARN
(
"Invalid cipher list: %s"
,
config
->
cipher_list
);
}
ssl_ok
=
1
;
ICECAST_LOG_INFO
(
"SSL certificate found at %s"
,
config
->
cert_file
);
ICECAST_LOG_INFO
(
"SSL using ciphers %s"
,
config
->
cipher_list
);
ICECAST_LOG_INFO
(
"SSL using ciphers %s"
,
config
->
cipher_list
);
return
;
}
while
(
0
);
ICECAST_LOG_INFO
(
"No SSL capability on any configured ports"
);
...
...
@@ -1337,7 +1337,7 @@ static void _handle_authentication_global(client_t *client, void *uri, auth_resu
auth_stack_release
(
client
->
authstack
);
client
->
authstack
=
NULL
;
if
(
result
!=
AUTH_NOMATCH
&&
if
(
result
!=
AUTH_NOMATCH
&&
!
(
result
==
AUTH_OK
&&
client
->
admin_command
!=
-
1
&&
acl_test_admin
(
client
->
acl
,
client
->
admin_command
)
==
ACL_POLICY_DENY
))
{
_handle_authed_client
(
client
,
uri
,
result
);
return
;
...
...
@@ -1529,7 +1529,7 @@ static void _handle_connection(void)
}
_handle_authentication
(
client
,
uri
);
}
}
else
{
free
(
node
);
...
...
src/format.c
View file @
11d5dffd
...
...
@@ -3,7 +3,7 @@
* This program is distributed under the GNU General Public License, version 2.
* 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>,
* oddsock <oddsock@xiph.org>,
* Karl Heyes <karl@xiph.org>
...
...
@@ -96,7 +96,7 @@ int format_get_plugin(format_type_t type, source_t *source)
break
;
}
if
(
ret
<
0
)
stats_event
(
source
->
mount
,
"content-type"
,
stats_event
(
source
->
mount
,
"content-type"
,
source
->
format
->
contenttype
);
return
ret
;
...
...
@@ -104,7 +104,7 @@ int format_get_plugin(format_type_t type, source_t *source)
/* clients need to be start from somewhere in the queue so we will look for
* a refbuf which has been previously marked as a sync point.
* a refbuf which has been previously marked as a sync point.
*/
static
void
find_client_start
(
source_t
*
source
,
client_t
*
client
)
{
...
...
@@ -259,7 +259,7 @@ int format_generic_write_to_client(client_t *client)
/* This is the commonly used for source streams, here we just progress to
* the next buffer in the queue if there is no more left to be written from
* the next buffer in the queue if there is no more left to be written from
* the existing buffer.
*/
int
format_advance_queue
(
source_t
*
source
,
client_t
*
client
)
...
...
@@ -338,7 +338,7 @@ static int format_prepare_headers (source_t *source, client_t *client)
if
(
bitrate_filtered
==
0
)
brfield
=
strstr
(
var
->
value
,
"bitrate="
);
if
(
brfield
&&
sscanf
(
brfield
,
"bitrate=%u"
,
&
bitrate
))
{
{
bytes
=
snprintf
(
ptr
,
remaining
,
"icy-br:%u
\r\n
"
,
bitrate
);
next
=
0
;
bitrate_filtered
=
1
;
...
...
src/format_ebml.c
View file @
11d5dffd
...
...
@@ -124,11 +124,11 @@ static int send_ebml_header(client_t *client)