[xiph-commits] r18650 - icecast/trunk/icecast/src

ph3-der-loewe at svn.xiph.org ph3-der-loewe at svn.xiph.org
Thu Oct 11 15:49:57 PDT 2012


Author: ph3-der-loewe
Date: 2012-10-11 15:49:57 -0700 (Thu, 11 Oct 2012)
New Revision: 18650

Modified:
   icecast/trunk/icecast/src/client.c
   icecast/trunk/icecast/src/client.h
   icecast/trunk/icecast/src/format_mp3.c
   icecast/trunk/icecast/src/main.c
   icecast/trunk/icecast/src/sighandler.c
Log:
avoid compiler warnings; send /message/ in case of 403.

Modified: icecast/trunk/icecast/src/client.c
===================================================================
--- icecast/trunk/icecast/src/client.c	2012-10-11 22:28:40 UTC (rev 18649)
+++ icecast/trunk/icecast/src/client.c	2012-10-11 22:49:57 UTC (rev 18650)
@@ -182,7 +182,7 @@
     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 @@
     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);
 }
 
 

Modified: icecast/trunk/icecast/src/client.h
===================================================================
--- icecast/trunk/icecast/src/client.h	2012-10-11 22:28:40 UTC (rev 18649)
+++ icecast/trunk/icecast/src/client.h	2012-10-11 22:49:57 UTC (rev 18650)
@@ -69,11 +69,10 @@
 
 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);

Modified: icecast/trunk/icecast/src/format_mp3.c
===================================================================
--- icecast/trunk/icecast/src/format_mp3.c	2012-10-11 22:28:40 UTC (rev 18649)
+++ icecast/trunk/icecast/src/format_mp3.c	2012-10-11 22:49:57 UTC (rev 18650)
@@ -293,9 +293,9 @@
             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)

Modified: icecast/trunk/icecast/src/main.c
===================================================================
--- icecast/trunk/icecast/src/main.c	2012-10-11 22:28:40 UTC (rev 18649)
+++ icecast/trunk/icecast/src/main.c	2012-10-11 22:49:57 UTC (rev 18650)
@@ -394,14 +394,14 @@
            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

Modified: icecast/trunk/icecast/src/sighandler.c
===================================================================
--- icecast/trunk/icecast/src/sighandler.c	2012-10-11 22:28:40 UTC (rev 18649)
+++ icecast/trunk/icecast/src/sighandler.c	2012-10-11 22:49:57 UTC (rev 18650)
@@ -54,6 +54,8 @@
 
 void _sig_hup(int signo)
 {
+    INFO1("Caught signal %d, scheduling config re-read...", signo);
+
     global_lock();
     global . schedule_config_reread = 1;
     global_unlock();



More information about the commits mailing list