gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r13023 - in libmicrohttpd: . src/daemon src/include


From: gnunet
Subject: [GNUnet-SVN] r13023 - in libmicrohttpd: . src/daemon src/include
Date: Sat, 18 Sep 2010 07:17:21 +0200

Author: grothoff
Date: 2010-09-18 07:17:21 +0200 (Sat, 18 Sep 2010)
New Revision: 13023

Modified:
   libmicrohttpd/ChangeLog
   libmicrohttpd/src/daemon/connection.c
   libmicrohttpd/src/include/microhttpd.h
Log:
experimental SHOUTcast support

Modified: libmicrohttpd/ChangeLog
===================================================================
--- libmicrohttpd/ChangeLog     2010-09-18 05:00:22 UTC (rev 13022)
+++ libmicrohttpd/ChangeLog     2010-09-18 05:17:21 UTC (rev 13023)
@@ -1,3 +1,6 @@
+Sat Sep 18 07:16:30 CEST 2010
+       Adding support for SHOUTcast. -CG
+
 Wed Sep 15 09:33:46 CEST 2010
        Fixed double-free. -CG/ES
 

Modified: libmicrohttpd/src/daemon/connection.c
===================================================================
--- libmicrohttpd/src/daemon/connection.c       2010-09-18 05:00:22 UTC (rev 
13022)
+++ libmicrohttpd/src/daemon/connection.c       2010-09-18 05:17:21 UTC (rev 
13023)
@@ -588,6 +588,7 @@
   char *data;
   enum MHD_ValueKind kind;
   const char *reason_phrase;
+  uint32_t rc;
 
   EXTRA_CHECK (NULL != connection->version);
   if (0 == strlen(connection->version))
@@ -602,14 +603,17 @@
   if (connection->state == MHD_CONNECTION_FOOTERS_RECEIVED)
     {
       add_extra_headers (connection);
-      reason_phrase = MHD_get_reason_phrase_for (connection->responseCode);
+      rc = connection->responseCode & (~MHD_ICY_FLAG);
+      reason_phrase = MHD_get_reason_phrase_for (rc);
       SPRINTF (code,
                "%s %u %s\r\n",
-               (0 == strcasecmp (MHD_HTTP_VERSION_1_0,
-                                connection->version)) 
-              ? MHD_HTTP_VERSION_1_0 
-              : MHD_HTTP_VERSION_1_1,
-              connection->responseCode, 
+              (0 != (connection->responseCode & MHD_ICY_FLAG))
+              ? "ICY" 
+              : ( (0 == strcasecmp (MHD_HTTP_VERSION_1_0,
+                                    connection->version)) 
+                  ? MHD_HTTP_VERSION_1_0 
+                  : MHD_HTTP_VERSION_1_1_),
+              rc, 
               reason_phrase);
       off = strlen (code);
       /* estimate size */

Modified: libmicrohttpd/src/include/microhttpd.h
===================================================================
--- libmicrohttpd/src/include/microhttpd.h      2010-09-18 05:00:22 UTC (rev 
13022)
+++ libmicrohttpd/src/include/microhttpd.h      2010-09-18 05:17:21 UTC (rev 
13023)
@@ -190,6 +190,13 @@
 #define MHD_HTTP_BANDWIDTH_LIMIT_EXCEEDED 509
 #define MHD_HTTP_NOT_EXTENDED 510
 
+/**
+ * Flag to be "OR"ed with MHD_HTTP status code for
+ * SHOUTcast.  This will cause the response to begin
+ * with the SHOUTcast "ICY" line instad of "HTTP".
+ */ 
+#define MHD_ICY_FLAG ((uint32_t)(1 << 31))
+
 /* See also: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html */
 #define MHD_HTTP_HEADER_ACCEPT "Accept"
 #define MHD_HTTP_HEADER_ACCEPT_CHARSET "Accept-Charset"




reply via email to

[Prev in Thread] Current Thread [Next in Thread]