mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2024-12-04 14:46:30 -05:00
avoid compiler warnings; send /message/ in case of 403.
svn path=/icecast/trunk/icecast/; revision=18650
This commit is contained in:
parent
61c9def238
commit
27ba19f014
16
src/client.c
16
src/client.c
@ -182,7 +182,7 @@ int client_read_bytes (client_t *client, void *buf, unsigned len)
|
||||
return bytes;
|
||||
}
|
||||
|
||||
static void client_send_error0(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_error0(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_error0(client, 404, 0, message);
|
||||
client_send_error(client, 404, 0, message);
|
||||
}
|
||||
|
||||
void client_send_401(client_t *client)
|
||||
{
|
||||
client_send_error0(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_error0(client, 403, 1, "Forbidden");
|
||||
client_send_error(client, 403, 1, message);
|
||||
}
|
||||
|
||||
|
||||
|
@ -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);
|
||||
|
@ -293,9 +293,9 @@ static void mp3_set_title (source_t *source)
|
||||
if (source_mp3->inline_url)
|
||||
{
|
||||
char *end = strstr (source_mp3->inline_url, "';");
|
||||
int 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)
|
||||
|
@ -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
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user