gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r34473 - in libmicrohttpd: . src/include src/microhttpd


From: gnunet
Subject: [GNUnet-SVN] r34473 - in libmicrohttpd: . src/include src/microhttpd
Date: Thu, 4 Dec 2014 00:47:40 +0100

Author: grothoff
Date: 2014-12-04 00:47:40 +0100 (Thu, 04 Dec 2014)
New Revision: 34473

Modified:
   libmicrohttpd/ChangeLog
   libmicrohttpd/src/include/microhttpd.h
   libmicrohttpd/src/microhttpd/connection.c
Log:
From:
"Junker, Gregory" <address@hidden>
Date:
12/04/2014 12:30 AM
To:
"address@hidden" <address@hidden>

Hi all

I need a tiny addition made to connection.c.

In keepalive_possible(), can we change the line that says

    if (0 == strcasecmp (end, "close"))

to



    if (0 == strcasecmp (end, "close") || 0 == strcasecmp (end, "upgrade"))

?

This would make it possible to use libmicrohttpd in a WebSocket (RFC6455) 
environment. Currently, the way that the WebSocket protocol works, it sends 
"Connection: Upgrade" in the headers with the initial handshake, which causes 
this check to fail and (ultimately) insert "Connection: Keep-Alive" in the 
response headers (which cause any compliant WebSocket client to fail the 
handshake, since it needs "Connection: Upgrade" in the response headers, and 
there is no way to remove this keepalive header from the response from outside 
of MHD, as it is added automatically to the response buffer).

Note that this is only an HTTP/1.1 issue, AFAIK (I am pretty sure, though not 
positive, that WebSocket is not compatible with HTTP/1.0).

Thanks!
Greg




Modified: libmicrohttpd/ChangeLog
===================================================================
--- libmicrohttpd/ChangeLog     2014-12-03 17:19:26 UTC (rev 34472)
+++ libmicrohttpd/ChangeLog     2014-12-03 23:47:40 UTC (rev 34473)
@@ -1,3 +1,7 @@
+Thu Dec  4 00:43:10 CET 2014
+       If "Connection: upgrade" is requested, do not add
+       "Connection: Keep-Alive" in the response. -GJ
+
 Tue Nov 18 13:52:29 CET 2014
        Call MHD_cleanup_connections() during 
MHD_DAEMON_INFO_CURRENT_CONNECTIONS
        processing for more accurate results. -MS

Modified: libmicrohttpd/src/include/microhttpd.h
===================================================================
--- libmicrohttpd/src/include/microhttpd.h      2014-12-03 17:19:26 UTC (rev 
34472)
+++ libmicrohttpd/src/include/microhttpd.h      2014-12-03 23:47:40 UTC (rev 
34473)
@@ -130,7 +130,7 @@
  * Current version of the library.
  * 0x01093001 = 1.9.30-1.
  */
-#define MHD_VERSION 0x00093801
+#define MHD_VERSION 0x00093802
 
 /**
  * MHD-internal return code for "YES".

Modified: libmicrohttpd/src/microhttpd/connection.c
===================================================================
--- libmicrohttpd/src/microhttpd/connection.c   2014-12-03 17:19:26 UTC (rev 
34472)
+++ libmicrohttpd/src/microhttpd/connection.c   2014-12-03 23:47:40 UTC (rev 
34473)
@@ -524,9 +524,10 @@
   {
     if (NULL == end)
       return MHD_YES;
-    if (0 == strcasecmp (end, "close"))
+    if ( (0 == strcasecmp (end, "close")) ||
+         (0 == strcasecmp (end, "upgrade")) )
       return MHD_NO;
-    return MHD_YES;
+   return MHD_YES;
   }
   if (0 == strcasecmp (connection->version,
                        MHD_HTTP_VERSION_1_0))




reply via email to

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