Commit 27ba19f0 authored by Philipp Schafft's avatar Philipp Schafft 🦁

avoid compiler warnings; send /message/ in case of 403.

svn path=/icecast/trunk/icecast/; revision=18650
parent 61c9def2
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment