Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xiph.Org
Icecast-Server
Commits
5f8cfd70
Commit
5f8cfd70
authored
Aug 16, 2007
by
Karl Heyes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
const updates, no functional changes
svn path=/icecast/trunk/icecast/; revision=13559
parent
eebb33b8
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
63 additions
and
59 deletions
+63
-59
src/admin.c
src/admin.c
+17
-17
src/admin.h
src/admin.h
+1
-1
src/auth.c
src/auth.c
+1
-1
src/connection.c
src/connection.c
+12
-10
src/format.c
src/format.c
+1
-1
src/format.h
src/format.h
+3
-3
src/format_mp3.c
src/format_mp3.c
+4
-4
src/format_vorbis.c
src/format_vorbis.c
+2
-2
src/fserve.c
src/fserve.c
+2
-2
src/logging.c
src/logging.c
+1
-1
src/source.c
src/source.c
+3
-2
src/util.c
src/util.c
+10
-9
src/util.h
src/util.h
+6
-6
No files found.
src/admin.c
View file @
5f8cfd70
...
@@ -110,7 +110,7 @@
...
@@ -110,7 +110,7 @@
#define DEFAULT_TRANSFORMED_REQUEST ""
#define DEFAULT_TRANSFORMED_REQUEST ""
#define BUILDM3U_RAW_REQUEST "buildm3u"
#define BUILDM3U_RAW_REQUEST "buildm3u"
int
admin_get_command
(
char
*
command
)
int
admin_get_command
(
const
char
*
command
)
{
{
if
(
!
strcmp
(
command
,
FALLBACK_RAW_REQUEST
))
if
(
!
strcmp
(
command
,
FALLBACK_RAW_REQUEST
))
return
COMMAND_RAW_FALLBACK
;
return
COMMAND_RAW_FALLBACK
;
...
@@ -303,9 +303,9 @@ void admin_send_response (xmlDocPtr doc, client_t *client,
...
@@ -303,9 +303,9 @@ void admin_send_response (xmlDocPtr doc, client_t *client,
}
}
void
admin_handle_request
(
client_t
*
client
,
char
*
uri
)
void
admin_handle_request
(
client_t
*
client
,
const
char
*
uri
)
{
{
char
*
mount
,
*
command_string
;
const
char
*
mount
,
*
command_string
;
int
command
;
int
command
;
int
noauth
=
0
;
int
noauth
=
0
;
...
@@ -337,7 +337,7 @@ void admin_handle_request(client_t *client, char *uri)
...
@@ -337,7 +337,7 @@ void admin_handle_request(client_t *client, char *uri)
if
(
command
==
COMMAND_SHOUTCAST_METADATA_UPDATE
)
{
if
(
command
==
COMMAND_SHOUTCAST_METADATA_UPDATE
)
{
ice_config_t
*
config
;
ice_config_t
*
config
;
char
*
pass
=
httpp_get_query_param
(
client
->
parser
,
"pass"
);
const
char
*
pass
=
httpp_get_query_param
(
client
->
parser
,
"pass"
);
if
(
pass
==
NULL
)
if
(
pass
==
NULL
)
{
{
client_send_400
(
client
,
"missing pass parameter"
);
client_send_400
(
client
,
"missing pass parameter"
);
...
@@ -556,7 +556,7 @@ static void html_success(client_t *client, char *message)
...
@@ -556,7 +556,7 @@ static void html_success(client_t *client, char *message)
static
void
command_move_clients
(
client_t
*
client
,
source_t
*
source
,
static
void
command_move_clients
(
client_t
*
client
,
source_t
*
source
,
int
response
)
int
response
)
{
{
char
*
dest_source
;
const
char
*
dest_source
;
source_t
*
dest
;
source_t
*
dest
;
xmlDocPtr
doc
;
xmlDocPtr
doc
;
xmlNodePtr
node
;
xmlNodePtr
node
;
...
@@ -623,7 +623,7 @@ static void command_show_listeners(client_t *client, source_t *source,
...
@@ -623,7 +623,7 @@ static void command_show_listeners(client_t *client, source_t *source,
avl_node
*
client_node
;
avl_node
*
client_node
;
client_t
*
current
;
client_t
*
current
;
char
buf
[
22
];
char
buf
[
22
];
char
*
userAgent
=
NULL
;
const
char
*
userAgent
=
NULL
;
time_t
now
=
time
(
NULL
);
time_t
now
=
time
(
NULL
);
doc
=
xmlNewDoc
(
"1.0"
);
doc
=
xmlNewDoc
(
"1.0"
);
...
@@ -671,8 +671,8 @@ static void command_show_listeners(client_t *client, source_t *source,
...
@@ -671,8 +671,8 @@ static void command_show_listeners(client_t *client, source_t *source,
static
void
command_buildm3u
(
client_t
*
client
,
source_t
*
source
,
static
void
command_buildm3u
(
client_t
*
client
,
source_t
*
source
,
int
response
)
int
response
)
{
{
char
*
username
=
NULL
;
const
char
*
username
=
NULL
;
char
*
password
=
NULL
;
const
char
*
password
=
NULL
;
ice_config_t
*
config
;
ice_config_t
*
config
;
COMMAND_REQUIRE
(
client
,
"username"
,
username
);
COMMAND_REQUIRE
(
client
,
"username"
,
username
);
...
@@ -703,9 +703,9 @@ static void command_manageauth(client_t *client, source_t *source,
...
@@ -703,9 +703,9 @@ static void command_manageauth(client_t *client, source_t *source,
{
{
xmlDocPtr
doc
;
xmlDocPtr
doc
;
xmlNodePtr
node
,
srcnode
,
msgnode
;
xmlNodePtr
node
,
srcnode
,
msgnode
;
char
*
action
=
NULL
;
const
char
*
action
=
NULL
;
char
*
username
=
NULL
;
const
char
*
username
=
NULL
;
char
*
password
=
NULL
;
const
char
*
password
=
NULL
;
char
*
message
=
NULL
;
char
*
message
=
NULL
;
int
ret
=
AUTH_OK
;
int
ret
=
AUTH_OK
;
ice_config_t
*
config
=
config_get_config
();
ice_config_t
*
config
=
config_get_config
();
...
@@ -792,7 +792,7 @@ static void command_kill_source(client_t *client, source_t *source,
...
@@ -792,7 +792,7 @@ static void command_kill_source(client_t *client, source_t *source,
static
void
command_kill_client
(
client_t
*
client
,
source_t
*
source
,
static
void
command_kill_client
(
client_t
*
client
,
source_t
*
source
,
int
response
)
int
response
)
{
{
char
*
idtext
;
const
char
*
idtext
;
int
id
;
int
id
;
client_t
*
listener
;
client_t
*
listener
;
xmlDocPtr
doc
;
xmlDocPtr
doc
;
...
@@ -836,7 +836,7 @@ static void command_kill_client(client_t *client, source_t *source,
...
@@ -836,7 +836,7 @@ static void command_kill_client(client_t *client, source_t *source,
static
void
command_fallback
(
client_t
*
client
,
source_t
*
source
,
static
void
command_fallback
(
client_t
*
client
,
source_t
*
source
,
int
response
)
int
response
)
{
{
char
*
fallback
;
const
char
*
fallback
;
char
*
old
;
char
*
old
;
DEBUG0
(
"Got fallback request"
);
DEBUG0
(
"Got fallback request"
);
...
@@ -853,8 +853,8 @@ static void command_fallback(client_t *client, source_t *source,
...
@@ -853,8 +853,8 @@ static void command_fallback(client_t *client, source_t *source,
static
void
command_metadata
(
client_t
*
client
,
source_t
*
source
,
static
void
command_metadata
(
client_t
*
client
,
source_t
*
source
,
int
response
)
int
response
)
{
{
char
*
action
;
const
char
*
action
;
char
*
song
,
*
title
,
*
artist
;
const
char
*
song
,
*
title
,
*
artist
;
format_plugin_t
*
plugin
;
format_plugin_t
*
plugin
;
xmlDocPtr
doc
;
xmlDocPtr
doc
;
xmlNodePtr
node
;
xmlNodePtr
node
;
...
@@ -920,8 +920,8 @@ static void command_metadata(client_t *client, source_t *source,
...
@@ -920,8 +920,8 @@ static void command_metadata(client_t *client, source_t *source,
static
void
command_shoutcast_metadata
(
client_t
*
client
,
source_t
*
source
)
static
void
command_shoutcast_metadata
(
client_t
*
client
,
source_t
*
source
)
{
{
char
*
action
;
const
char
*
action
;
char
*
value
;
const
char
*
value
;
DEBUG0
(
"Got shoutcast metadata update request"
);
DEBUG0
(
"Got shoutcast metadata update request"
);
...
...
src/admin.h
View file @
5f8cfd70
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
#define TRANSFORMED 2
#define TRANSFORMED 2
#define PLAINTEXT 3
#define PLAINTEXT 3
void
admin_handle_request
(
client_t
*
client
,
char
*
uri
);
void
admin_handle_request
(
client_t
*
client
,
const
char
*
uri
);
void
admin_send_response
(
xmlDocPtr
doc
,
client_t
*
client
,
void
admin_send_response
(
xmlDocPtr
doc
,
client_t
*
client
,
int
response
,
const
char
*
xslt_template
);
int
response
,
const
char
*
xslt_template
);
...
...
src/auth.c
View file @
5f8cfd70
...
@@ -47,7 +47,7 @@ static thread_type *auth_thread;
...
@@ -47,7 +47,7 @@ static thread_type *auth_thread;
static
void
auth_client_setup
(
mount_proxy
*
mountinfo
,
client_t
*
client
)
static
void
auth_client_setup
(
mount_proxy
*
mountinfo
,
client_t
*
client
)
{
{
/* This will look something like "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" */
/* This will look something like "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" */
char
*
header
=
httpp_getvar
(
client
->
parser
,
"authorization"
);
const
char
*
header
=
httpp_getvar
(
client
->
parser
,
"authorization"
);
char
*
userpass
,
*
tmp
;
char
*
userpass
,
*
tmp
;
char
*
username
,
*
password
;
char
*
username
,
*
password
;
...
...
src/connection.c
View file @
5f8cfd70
...
@@ -515,7 +515,7 @@ int connection_complete_source (source_t *source, int response)
...
@@ -515,7 +515,7 @@ int connection_complete_source (source_t *source, int response)
if
(
global
.
sources
<
config
->
source_limit
)
if
(
global
.
sources
<
config
->
source_limit
)
{
{
char
*
contenttype
;
const
char
*
contenttype
;
mount_proxy
*
mountinfo
;
mount_proxy
*
mountinfo
;
format_type_t
format_type
;
format_type_t
format_type
;
...
@@ -590,10 +590,10 @@ int connection_complete_source (source_t *source, int response)
...
@@ -590,10 +590,10 @@ int connection_complete_source (source_t *source, int response)
static
int
_check_pass_http
(
http_parser_t
*
parser
,
static
int
_check_pass_http
(
http_parser_t
*
parser
,
char
*
correctuser
,
char
*
correctpass
)
const
char
*
correctuser
,
const
char
*
correctpass
)
{
{
/* This will look something like "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" */
/* This will look something like "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" */
char
*
header
=
httpp_getvar
(
parser
,
"authorization"
);
const
char
*
header
=
httpp_getvar
(
parser
,
"authorization"
);
char
*
userpass
,
*
tmp
;
char
*
userpass
,
*
tmp
;
char
*
username
,
*
password
;
char
*
username
,
*
password
;
...
@@ -628,9 +628,9 @@ static int _check_pass_http(http_parser_t *parser,
...
@@ -628,9 +628,9 @@ static int _check_pass_http(http_parser_t *parser,
return
1
;
return
1
;
}
}
static
int
_check_pass_icy
(
http_parser_t
*
parser
,
char
*
correctpass
)
static
int
_check_pass_icy
(
http_parser_t
*
parser
,
const
char
*
correctpass
)
{
{
char
*
password
;
const
char
*
password
;
password
=
httpp_getvar
(
parser
,
HTTPP_VAR_ICYPASSWORD
);
password
=
httpp_getvar
(
parser
,
HTTPP_VAR_ICYPASSWORD
);
if
(
!
password
)
if
(
!
password
)
...
@@ -642,9 +642,9 @@ static int _check_pass_icy(http_parser_t *parser, char *correctpass)
...
@@ -642,9 +642,9 @@ static int _check_pass_icy(http_parser_t *parser, char *correctpass)
return
1
;
return
1
;
}
}
static
int
_check_pass_ice
(
http_parser_t
*
parser
,
char
*
correctpass
)
static
int
_check_pass_ice
(
http_parser_t
*
parser
,
const
char
*
correctpass
)
{
{
char
*
password
;
const
char
*
password
;
password
=
httpp_getvar
(
parser
,
"ice-password"
);
password
=
httpp_getvar
(
parser
,
"ice-password"
);
if
(
!
password
)
if
(
!
password
)
...
@@ -662,7 +662,7 @@ int connection_check_admin_pass(http_parser_t *parser)
...
@@ -662,7 +662,7 @@ int connection_check_admin_pass(http_parser_t *parser)
ice_config_t
*
config
=
config_get_config
();
ice_config_t
*
config
=
config_get_config
();
char
*
pass
=
config
->
admin_password
;
char
*
pass
=
config
->
admin_password
;
char
*
user
=
config
->
admin_username
;
char
*
user
=
config
->
admin_username
;
char
*
protocol
;
const
char
*
protocol
;
if
(
!
pass
||
!
user
)
{
if
(
!
pass
||
!
user
)
{
config_release_config
();
config_release_config
();
...
@@ -702,7 +702,7 @@ int connection_check_source_pass(http_parser_t *parser, const char *mount)
...
@@ -702,7 +702,7 @@ int connection_check_source_pass(http_parser_t *parser, const char *mount)
char
*
user
=
"source"
;
char
*
user
=
"source"
;
int
ret
;
int
ret
;
int
ice_login
=
config
->
ice_login
;
int
ice_login
=
config
->
ice_login
;
char
*
protocol
;
const
char
*
protocol
;
mount_proxy
*
mountinfo
=
config_find_mount
(
config
,
mount
);
mount_proxy
*
mountinfo
=
config_find_mount
(
config
,
mount
);
...
@@ -995,7 +995,7 @@ static void _handle_shoutcast_compatible (client_queue_t *node)
...
@@ -995,7 +995,7 @@ static void _handle_shoutcast_compatible (client_queue_t *node)
static
void
*
_handle_connection
(
void
*
arg
)
static
void
*
_handle_connection
(
void
*
arg
)
{
{
http_parser_t
*
parser
;
http_parser_t
*
parser
;
char
*
rawuri
,
*
uri
;
const
char
*
rawuri
;
while
(
global
.
running
==
ICE_RUNNING
)
{
while
(
global
.
running
==
ICE_RUNNING
)
{
...
@@ -1018,6 +1018,8 @@ static void *_handle_connection(void *arg)
...
@@ -1018,6 +1018,8 @@ static void *_handle_connection(void *arg)
client
->
parser
=
parser
;
client
->
parser
=
parser
;
if
(
httpp_parse
(
parser
,
client
->
refbuf
->
data
,
node
->
offset
))
if
(
httpp_parse
(
parser
,
client
->
refbuf
->
data
,
node
->
offset
))
{
{
char
*
uri
;
/* we may have more than just headers, so prepare for it */
/* we may have more than just headers, so prepare for it */
if
(
node
->
stream_offset
==
node
->
offset
)
if
(
node
->
stream_offset
==
node
->
offset
)
client
->
refbuf
->
len
=
0
;
client
->
refbuf
->
len
=
0
;
...
...
src/format.c
View file @
5f8cfd70
...
@@ -52,7 +52,7 @@
...
@@ -52,7 +52,7 @@
static
int
format_prepare_headers
(
source_t
*
source
,
client_t
*
client
);
static
int
format_prepare_headers
(
source_t
*
source
,
client_t
*
client
);
format_type_t
format_get_type
(
char
*
contenttype
)
format_type_t
format_get_type
(
const
char
*
contenttype
)
{
{
if
(
strcmp
(
contenttype
,
"application/x-ogg"
)
==
0
)
if
(
strcmp
(
contenttype
,
"application/x-ogg"
)
==
0
)
return
FORMAT_TYPE_OGG
;
/* Backwards compatibility */
return
FORMAT_TYPE_OGG
;
/* Backwards compatibility */
...
...
src/format.h
View file @
5f8cfd70
...
@@ -39,7 +39,7 @@ typedef struct _format_plugin_tag
...
@@ -39,7 +39,7 @@ typedef struct _format_plugin_tag
/* we need to know the mount to report statistics */
/* we need to know the mount to report statistics */
char
*
mount
;
char
*
mount
;
char
*
contenttype
;
const
char
*
contenttype
;
uint64_t
read_bytes
;
uint64_t
read_bytes
;
uint64_t
sent_bytes
;
uint64_t
sent_bytes
;
...
@@ -47,7 +47,7 @@ typedef struct _format_plugin_tag
...
@@ -47,7 +47,7 @@ typedef struct _format_plugin_tag
int
(
*
write_buf_to_client
)(
client_t
*
client
);
int
(
*
write_buf_to_client
)(
client_t
*
client
);
void
(
*
write_buf_to_file
)(
struct
source_tag
*
source
,
refbuf_t
*
refbuf
);
void
(
*
write_buf_to_file
)(
struct
source_tag
*
source
,
refbuf_t
*
refbuf
);
int
(
*
create_client_data
)(
struct
source_tag
*
source
,
client_t
*
client
);
int
(
*
create_client_data
)(
struct
source_tag
*
source
,
client_t
*
client
);
void
(
*
set_tag
)(
struct
_format_plugin_tag
*
plugin
,
char
*
tag
,
char
*
value
);
void
(
*
set_tag
)(
struct
_format_plugin_tag
*
plugin
,
const
char
*
tag
,
const
char
*
value
);
void
(
*
free_plugin
)(
struct
_format_plugin_tag
*
self
);
void
(
*
free_plugin
)(
struct
_format_plugin_tag
*
self
);
void
(
*
apply_settings
)(
client_t
*
client
,
struct
_format_plugin_tag
*
format
,
struct
_mount_proxy
*
mount
);
void
(
*
apply_settings
)(
client_t
*
client
,
struct
_format_plugin_tag
*
format
,
struct
_mount_proxy
*
mount
);
...
@@ -55,7 +55,7 @@ typedef struct _format_plugin_tag
...
@@ -55,7 +55,7 @@ typedef struct _format_plugin_tag
void
*
_state
;
void
*
_state
;
}
format_plugin_t
;
}
format_plugin_t
;
format_type_t
format_get_type
(
char
*
contenttype
);
format_type_t
format_get_type
(
const
char
*
contenttype
);
char
*
format_get_mimetype
(
format_type_t
type
);
char
*
format_get_mimetype
(
format_type_t
type
);
int
format_get_plugin
(
format_type_t
type
,
struct
source_tag
*
source
);
int
format_get_plugin
(
format_type_t
type
,
struct
source_tag
*
source
);
...
...
src/format_mp3.c
View file @
5f8cfd70
...
@@ -61,7 +61,7 @@ static int format_mp3_create_client_data (source_t *source, client_t *client);
...
@@ -61,7 +61,7 @@ static int format_mp3_create_client_data (source_t *source, client_t *client);
static
void
free_mp3_client_data
(
client_t
*
client
);
static
void
free_mp3_client_data
(
client_t
*
client
);
static
int
format_mp3_write_buf_to_client
(
client_t
*
client
);
static
int
format_mp3_write_buf_to_client
(
client_t
*
client
);
static
void
write_mp3_to_file
(
struct
source_tag
*
source
,
refbuf_t
*
refbuf
);
static
void
write_mp3_to_file
(
struct
source_tag
*
source
,
refbuf_t
*
refbuf
);
static
void
mp3_set_tag
(
format_plugin_t
*
plugin
,
char
*
tag
,
char
*
value
);
static
void
mp3_set_tag
(
format_plugin_t
*
plugin
,
const
char
*
tag
,
const
char
*
value
);
static
void
format_mp3_apply_settings
(
client_t
*
client
,
format_plugin_t
*
format
,
mount_proxy
*
mount
);
static
void
format_mp3_apply_settings
(
client_t
*
client
,
format_plugin_t
*
format
,
mount_proxy
*
mount
);
...
@@ -75,7 +75,7 @@ typedef struct {
...
@@ -75,7 +75,7 @@ typedef struct {
int
format_mp3_get_plugin
(
source_t
*
source
)
int
format_mp3_get_plugin
(
source_t
*
source
)
{
{
char
*
metadata
;
const
char
*
metadata
;
format_plugin_t
*
plugin
;
format_plugin_t
*
plugin
;
mp3_state
*
state
=
calloc
(
1
,
sizeof
(
mp3_state
));
mp3_state
*
state
=
calloc
(
1
,
sizeof
(
mp3_state
));
refbuf_t
*
meta
;
refbuf_t
*
meta
;
...
@@ -124,7 +124,7 @@ int format_mp3_get_plugin (source_t *source)
...
@@ -124,7 +124,7 @@ int format_mp3_get_plugin (source_t *source)
}
}
static
void
mp3_set_tag
(
format_plugin_t
*
plugin
,
char
*
tag
,
char
*
value
)
static
void
mp3_set_tag
(
format_plugin_t
*
plugin
,
const
char
*
tag
,
const
char
*
value
)
{
{
mp3_state
*
source_mp3
=
plugin
->
_state
;
mp3_state
*
source_mp3
=
plugin
->
_state
;
unsigned
int
len
;
unsigned
int
len
;
...
@@ -199,7 +199,7 @@ static void format_mp3_apply_settings (client_t *client, format_plugin_t *format
...
@@ -199,7 +199,7 @@ static void format_mp3_apply_settings (client_t *client, format_plugin_t *format
if
(
mount
==
NULL
||
mount
->
mp3_meta_interval
<
0
)
if
(
mount
==
NULL
||
mount
->
mp3_meta_interval
<
0
)
{
{
char
*
metadata
=
httpp_getvar
(
client
->
parser
,
"icy-metaint"
);
const
char
*
metadata
=
httpp_getvar
(
client
->
parser
,
"icy-metaint"
);
source_mp3
->
interval
=
-
1
;
source_mp3
->
interval
=
-
1
;
if
(
metadata
)
if
(
metadata
)
{
{
...
...
src/format_vorbis.c
View file @
5f8cfd70
...
@@ -67,7 +67,7 @@ static int process_vorbis_headers (ogg_state_t *ogg_info, ogg_codec_t *codec);
...
@@ -67,7 +67,7 @@ static int process_vorbis_headers (ogg_state_t *ogg_info, ogg_codec_t *codec);
static
refbuf_t
*
process_vorbis_page
(
ogg_state_t
*
ogg_info
,
static
refbuf_t
*
process_vorbis_page
(
ogg_state_t
*
ogg_info
,
ogg_codec_t
*
codec
,
ogg_page
*
page
);
ogg_codec_t
*
codec
,
ogg_page
*
page
);
static
refbuf_t
*
process_vorbis
(
ogg_state_t
*
ogg_info
,
ogg_codec_t
*
codec
);
static
refbuf_t
*
process_vorbis
(
ogg_state_t
*
ogg_info
,
ogg_codec_t
*
codec
);
static
void
vorbis_set_tag
(
format_plugin_t
*
plugin
,
char
*
tag
,
char
*
value
);
static
void
vorbis_set_tag
(
format_plugin_t
*
plugin
,
const
char
*
tag
,
const
char
*
value
);
static
void
free_ogg_packet
(
ogg_packet
*
packet
)
static
void
free_ogg_packet
(
ogg_packet
*
packet
)
...
@@ -413,7 +413,7 @@ ogg_codec_t *initial_vorbis_page (format_plugin_t *plugin, ogg_page *page)
...
@@ -413,7 +413,7 @@ ogg_codec_t *initial_vorbis_page (format_plugin_t *plugin, ogg_page *page)
/* called from the admin interface, here we update the artist/title info
/* called from the admin interface, here we update the artist/title info
* and schedule a new set of header pages
* and schedule a new set of header pages
*/
*/
static
void
vorbis_set_tag
(
format_plugin_t
*
plugin
,
char
*
tag
,
char
*
value
)
static
void
vorbis_set_tag
(
format_plugin_t
*
plugin
,
const
char
*
tag
,
const
char
*
value
)
{
{
ogg_state_t
*
ogg_info
=
plugin
->
_state
;
ogg_state_t
*
ogg_info
=
plugin
->
_state
;
ogg_codec_t
*
codec
=
ogg_info
->
codecs
;
ogg_codec_t
*
codec
=
ogg_info
->
codecs
;
...
...
src/fserve.c
View file @
5f8cfd70
...
@@ -375,7 +375,7 @@ int fserve_client_create (client_t *httpclient, const char *path)
...
@@ -375,7 +375,7 @@ int fserve_client_create (client_t *httpclient, const char *path)
{
{
int
bytes
;
int
bytes
;
struct
stat
file_buf
;
struct
stat
file_buf
;
char
*
range
=
NULL
;
const
char
*
range
=
NULL
;
int64_t
new_content_len
=
0
;
int64_t
new_content_len
=
0
;
int64_t
rangenumber
=
0
,
content_length
;
int64_t
rangenumber
=
0
,
content_length
;
int
rangeproblem
=
0
;
int
rangeproblem
=
0
;
...
@@ -414,7 +414,7 @@ int fserve_client_create (client_t *httpclient, const char *path)
...
@@ -414,7 +414,7 @@ int fserve_client_create (client_t *httpclient, const char *path)
if
(
m3u_requested
&&
m3u_file_available
==
0
)
if
(
m3u_requested
&&
m3u_file_available
==
0
)
{
{
char
*
host
=
httpp_getvar
(
httpclient
->
parser
,
"host"
);
const
char
*
host
=
httpp_getvar
(
httpclient
->
parser
,
"host"
);
char
*
sourceuri
=
strdup
(
path
);
char
*
sourceuri
=
strdup
(
path
);
char
*
dot
=
strrchr
(
sourceuri
,
'.'
);
char
*
dot
=
strrchr
(
sourceuri
,
'.'
);
...
...
src/logging.c
View file @
5f8cfd70
...
@@ -115,7 +115,7 @@ void logging_access(client_t *client)
...
@@ -115,7 +115,7 @@ void logging_access(client_t *client)
struct
tm
thetime
;
struct
tm
thetime
;
time_t
now
;
time_t
now
;
time_t
stayed
;
time_t
stayed
;
char
*
referrer
,
*
user_agent
,
*
username
;
const
char
*
referrer
,
*
user_agent
,
*
username
;
now
=
time
(
NULL
);
now
=
time
(
NULL
);
...
...
src/source.c
View file @
5f8cfd70
...
@@ -564,7 +564,8 @@ static void send_to_listener (source_t *source, client_t *client, int deletion_e
...
@@ -564,7 +564,8 @@ static void send_to_listener (source_t *source, client_t *client, int deletion_e
static
void
source_init
(
source_t
*
source
)
static
void
source_init
(
source_t
*
source
)
{
{
ice_config_t
*
config
=
config_get_config
();
ice_config_t
*
config
=
config_get_config
();
char
*
listenurl
,
*
str
;
char
*
listenurl
;
const
char
*
str
;
int
listen_url_size
;
int
listen_url_size
;
mount_proxy
*
mountinfo
;
mount_proxy
*
mountinfo
;
...
@@ -929,7 +930,7 @@ static void _parse_audio_info (source_t *source, const char *s)
...
@@ -929,7 +930,7 @@ static void _parse_audio_info (source_t *source, const char *s)
/* Apply the mountinfo details to the source */
/* Apply the mountinfo details to the source */
static
void
source_apply_mount
(
source_t
*
source
,
mount_proxy
*
mountinfo
)
static
void
source_apply_mount
(
source_t
*
source
,
mount_proxy
*
mountinfo
)
{
{
char
*
str
;
const
char
*
str
;
int
val
;
int
val
;
http_parser_t
*
parser
=
NULL
;
http_parser_t
*
parser
=
NULL
;
...
...
src/util.c
View file @
5f8cfd70
...
@@ -140,7 +140,7 @@ char *util_get_extension(const char *path) {
...
@@ -140,7 +140,7 @@ char *util_get_extension(const char *path) {
return
ext
+
1
;
return
ext
+
1
;
}
}
int
util_check_valid_extension
(
char
*
uri
)
{
int
util_check_valid_extension
(
const
char
*
uri
)
{
int
ret
=
0
;
int
ret
=
0
;
char
*
p2
;
char
*
p2
;
...
@@ -263,12 +263,12 @@ static char safechars[256] = {
...
@@ -263,12 +263,12 @@ static char safechars[256] = {
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
};
};
char
*
util_url_escape
(
char
*
src
)
char
*
util_url_escape
(
const
char
*
src
)
{
{
int
len
=
strlen
(
src
);
int
len
=
strlen
(
src
);
/* Efficiency not a big concern here, keep the code simple/conservative */
/* Efficiency not a big concern here, keep the code simple/conservative */
char
*
dst
=
calloc
(
1
,
len
*
3
+
1
);
char
*
dst
=
calloc
(
1
,
len
*
3
+
1
);
unsigned
char
*
source
=
src
;
unsigned
char
*
source
=
(
unsigned
char
*
)
src
;
int
i
,
j
=
0
;
int
i
,
j
=
0
;
for
(
i
=
0
;
i
<
len
;
i
++
)
{
for
(
i
=
0
;
i
<
len
;
i
++
)
{
...
@@ -287,10 +287,10 @@ char *util_url_escape(char *src)
...
@@ -287,10 +287,10 @@ char *util_url_escape(char *src)
return
dst
;
return
dst
;
}
}
char
*
util_url_unescape
(
char
*
src
)
char
*
util_url_unescape
(
const
char
*
src
)
{
{
int
len
=
strlen
(
src
);
int
len
=
strlen
(
src
);
unsigned
char
*
decoded
;
char
*
decoded
;
int
i
;
int
i
;
char
*
dst
;
char
*
dst
;
int
done
=
0
;
int
done
=
0
;
...
@@ -340,7 +340,7 @@ char *util_url_unescape(char *src)
...
@@ -340,7 +340,7 @@ char *util_url_unescape(char *src)
* escape from the webroot) or if it cannot be URI-decoded.
* escape from the webroot) or if it cannot be URI-decoded.
* Caller should free the path.
* Caller should free the path.
*/
*/
char
*
util_normalise_uri
(
char
*
uri
)
{
char
*
util_normalise_uri
(
const
char
*
uri
)
{
char
*
path
;
char
*
path
;
if
(
uri
[
0
]
!=
'/'
)
if
(
uri
[
0
]
!=
'/'
)
...
@@ -405,7 +405,7 @@ char *util_bin_to_hex(unsigned char *data, int len)
...
@@ -405,7 +405,7 @@ char *util_bin_to_hex(unsigned char *data, int len)
}
}
/* This isn't efficient, but it doesn't need to be */
/* This isn't efficient, but it doesn't need to be */
char
*
util_base64_encode
(
char
*
data
)
char
*
util_base64_encode
(
const
char
*
data
)
{
{
int
len
=
strlen
(
data
);
int
len
=
strlen
(
data
);
char
*
out
=
malloc
(
len
*
4
/
3
+
4
);
char
*
out
=
malloc
(
len
*
4
/
3
+
4
);
...
@@ -438,9 +438,10 @@ char *util_base64_encode(char *data)
...
@@ -438,9 +438,10 @@ char *util_base64_encode(char *data)
return
result
;
return
result
;
}
}
char
*
util_base64_decode
(
unsigned
char
*
input
)
char
*
util_base64_decode
(
const
char
*
data
)
{
{
int
len
=
strlen
(
input
);
const
unsigned
char
*
input
=
(
const
unsigned
char
*
)
data
;
int
len
=
strlen
(
data
);
char
*
out
=
malloc
(
len
*
3
/
4
+
5
);
char
*
out
=
malloc
(
len
*
3
/
4
+
5
);
char
*
result
=
out
;
char
*
result
=
out
;
signed
char
vals
[
4
];
signed
char
vals
[
4
];
...
...
src/util.h
View file @
5f8cfd70
...
@@ -21,17 +21,17 @@
...
@@ -21,17 +21,17 @@
int
util_timed_wait_for_fd
(
int
fd
,
int
timeout
);
int
util_timed_wait_for_fd
(
int
fd
,
int
timeout
);
int
util_read_header
(
int
sock
,
char
*
buff
,
unsigned
long
len
,
int
entire
);