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
Xiph.Org
Icecast-Server
Commits
27ba19f0
Commit
27ba19f0
authored
Oct 11, 2012
by
Philipp Schafft
🦁
Browse files
avoid compiler warnings; send /message/ in case of 403.
svn path=/icecast/trunk/icecast/; revision=18650
parent
61c9def2
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/client.c
View file @
27ba19f0
...
...
@@ -182,7 +182,7 @@ int client_read_bytes (client_t *client, void *buf, unsigned len)
return
bytes
;
}
static
void
client_send_error
0
(
client_t
*
client
,
int
status
,
int
plain
,
char
*
message
)
static
void
client_send_error
(
client_t
*
client
,
int
status
,
int
plain
,
const
char
*
message
)
{
ssize_t
ret
;
...
...
@@ -201,24 +201,24 @@ static void client_send_error0(client_t *client, int status, int plain, char *me
fserve_add_client
(
client
,
NULL
);
}
void
client_send_400
(
client_t
*
client
,
char
*
message
)
void
client_send_400
(
client_t
*
client
,
const
char
*
message
)
{
client_send_error
0
(
client
,
400
,
0
,
message
);
client_send_error
(
client
,
400
,
0
,
message
);
}
void
client_send_404
(
client_t
*
client
,
char
*
message
)
void
client_send_404
(
client_t
*
client
,
const
char
*
message
)
{
client_send_error
0
(
client
,
404
,
0
,
message
);
client_send_error
(
client
,
404
,
0
,
message
);
}
void
client_send_401
(
client_t
*
client
)
{
client_send_error
0
(
client
,
401
,
1
,
"You need to authenticate
\r\n
"
);
client_send_error
(
client
,
401
,
1
,
"You need to authenticate
\r\n
"
);
}
void
client_send_403
(
client_t
*
client
,
const
char
*
reason
)
void
client_send_403
(
client_t
*
client
,
const
char
*
message
)
{
client_send_error
0
(
client
,
403
,
1
,
"Forbidden"
);
client_send_error
(
client
,
403
,
1
,
message
);
}
...
...
src/client.h
View file @
27ba19f0
...
...
@@ -69,11 +69,10 @@ typedef struct _client_tag
int
client_create
(
client_t
**
c_ptr
,
connection_t
*
con
,
http_parser_t
*
parser
);
void
client_destroy
(
client_t
*
client
);
void
client_send_504
(
client_t
*
client
,
char
*
message
);
void
client_send_404
(
client_t
*
client
,
char
*
message
);
void
client_send_404
(
client_t
*
client
,
const
char
*
message
);
void
client_send_401
(
client_t
*
client
);
void
client_send_403
(
client_t
*
client
,
const
char
*
reason
);
void
client_send_400
(
client_t
*
client
,
char
*
message
);
void
client_send_403
(
client_t
*
client
,
const
char
*
message
);
void
client_send_400
(
client_t
*
client
,
const
char
*
message
);
int
client_send_bytes
(
client_t
*
client
,
const
void
*
buf
,
unsigned
len
);
int
client_read_bytes
(
client_t
*
client
,
void
*
buf
,
unsigned
len
);
void
client_set_queue
(
client_t
*
client
,
refbuf_t
*
refbuf
);
...
...
src/format_mp3.c
View file @
27ba19f0
...
...
@@ -293,9 +293,9 @@ static void mp3_set_title (source_t *source)
if
(
source_mp3
->
inline_url
)
{
char
*
end
=
strstr
(
source_mp3
->
inline_url
,
"';"
);
in
t
urllen
=
size
;
ssize_
t
urllen
=
size
;
if
(
end
)
urllen
=
end
-
source_mp3
->
inline_url
+
2
;
if
(
size
-
r
>
urllen
)
if
((
ssize_t
)
(
size
-
r
)
>
urllen
)
snprintf
(
p
->
data
+
r
,
size
-
r
,
"StreamUrl='%s';"
,
source_mp3
->
inline_url
+
11
);
}
else
if
(
source_mp3
->
url
)
...
...
src/main.c
View file @
27ba19f0
...
...
@@ -394,14 +394,14 @@ static void _ch_root_uid_setup(void)
return
;
}
if
(
gid
!=
-
1
)
{
if
(
gid
!=
(
gid_t
)
-
1
)
{
if
(
!
setgid
(
gid
))
fprintf
(
stdout
,
"Changed groupid to %i.
\n
"
,
(
int
)
gid
);
else
fprintf
(
stdout
,
"Error changing groupid: %s.
\n
"
,
strerror
(
errno
));
}
if
(
uid
!=
-
1
)
{
if
(
uid
!=
(
uid_t
)
-
1
)
{
if
(
!
setuid
(
uid
))
fprintf
(
stdout
,
"Changed userid to %i.
\n
"
,
(
int
)
uid
);
else
...
...
src/sighandler.c
View file @
27ba19f0
...
...
@@ -54,6 +54,8 @@ void _sig_ignore(int signo)
void
_sig_hup
(
int
signo
)
{
INFO1
(
"Caught signal %d, scheduling config re-read..."
,
signo
);
global_lock
();
global
.
schedule_config_reread
=
1
;
global_unlock
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment