[xiph-commits] r18806 - icecast/branches/ph3/icecast/src

ph3-der-loewe at svn.xiph.org ph3-der-loewe at svn.xiph.org
Sat Feb 23 18:12:35 PST 2013


Author: ph3-der-loewe
Date: 2013-02-23 18:12:35 -0800 (Sat, 23 Feb 2013)
New Revision: 18806

Modified:
   icecast/branches/ph3/icecast/src/format_mp3.c
   icecast/branches/ph3/icecast/src/util.c
   icecast/branches/ph3/icecast/src/yp.c
Log:
sync with master

Modified: icecast/branches/ph3/icecast/src/format_mp3.c
===================================================================
--- icecast/branches/ph3/icecast/src/format_mp3.c	2013-02-24 02:04:43 UTC (rev 18805)
+++ icecast/branches/ph3/icecast/src/format_mp3.c	2013-02-24 02:12:35 UTC (rev 18806)
@@ -679,10 +679,6 @@
         bytes = snprintf (ptr, remaining, "Content-Length: 221183499\r\n");
         remaining -= bytes;
         ptr += bytes;
-        /* avoid browser caching, reported via forum */
-        bytes = snprintf (ptr, remaining, "Expires: Mon, 26 Jul 1997 05:00:00 GMT\r\n");
-        remaining -= bytes;
-        ptr += bytes; 
     }
 
     client->format_data = client_mp3;

Modified: icecast/branches/ph3/icecast/src/util.c
===================================================================
--- icecast/branches/ph3/icecast/src/util.c	2013-02-24 02:04:43 UTC (rev 18805)
+++ icecast/branches/ph3/icecast/src/util.c	2013-02-24 02:12:35 UTC (rev 18806)
@@ -569,7 +569,9 @@
 			      currenttime_buffer,
 			      contenttype_buffer,
 			      (status == 401 ? "WWW-Authenticate: Basic realm=\"Icecast2 Server\"\r\n" : ""),
-                              (cache     ? "" : "Cache-Control: no-cache\r\n"),
+                              (cache     ? "" : "Cache-Control: no-cache\r\n"
+                                                "Expires: Mon, 26 Jul 1997 05:00:00 GMT\r\n"
+                                                "Pragma: no-cache\r\n"),
                               (datablock ? "\r\n" : ""),
                               (datablock ? datablock : ""));
     config_release_config();

Modified: icecast/branches/ph3/icecast/src/yp.c
===================================================================
--- icecast/branches/ph3/icecast/src/yp.c	2013-02-24 02:04:43 UTC (rev 18805)
+++ icecast/branches/ph3/icecast/src/yp.c	2013-02-24 02:12:35 UTC (rev 18806)
@@ -109,33 +109,34 @@
     unsigned bytes = size * nmemb;
 
     /* DEBUG2 ("header from YP is \"%.*s\"", bytes, ptr); */
-    if (strncmp (ptr, "YPResponse: 1", 13) == 0)
+    if (strncasecmp (ptr, "YPResponse: 1", 13) == 0)
         yp->cmd_ok = 1;
 
-    if (strncmp (ptr, "YPMessage: ", 11) == 0)
+    if (strncasecmp (ptr, "YPMessage: ", 11) == 0)
     {
         unsigned len = bytes - 11;
         free (yp->error_msg);
         yp->error_msg = calloc (1, len);
         if (yp->error_msg)
-            sscanf (ptr, "YPMessage: %[^\r\n]", yp->error_msg);
+            sscanf (ptr + 11, "%[^\r\n]", yp->error_msg);
     }
 
     if (yp->process == do_yp_add)
     {
-        if (strncmp (ptr, "SID: ", 5) == 0)
+        if (strncasecmp (ptr, "SID: ", 5) == 0)
         {
             unsigned len = bytes - 5;
             free (yp->sid);
             yp->sid = calloc (1, len);
             if (yp->sid)
-                sscanf (ptr, "SID: %[^\r\n]", yp->sid);
+                sscanf (ptr + 5, "%[^\r\n]", yp->sid);
         }
     }
-    if (strncmp (ptr, "TouchFreq: ", 11) == 0)
+    if (strncasecmp (ptr, "TouchFreq: ", 11) == 0)
     {
         unsigned secs;
-        sscanf (ptr, "TouchFreq: %u", &secs);
+        if ( sscanf (ptr + 11, "%u", &secs) != 1 )
+            secs = 0;
         if (secs < 30)
             secs = 30;
         DEBUG1 ("server touch interval is %u", secs);



More information about the commits mailing list