mirror of
https://git.gnunet.org/libmicrohttpd.git
synced 2026-10-01 04:03:18 +03:00
From:
"Junker, Gregory" <gregory.junker@intel.com> Date: 12/04/2014 12:30 AM To: "libmicrohttpd@gnu.org" <libmicrohttpd@gnu.org> 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
This commit is contained in:
1 parent
d5571974e5
commit
6ee22efc8b
3 files changed
+8
-3
No files matched your search
@@ -130,7 +130,7 @@ typedef intptr_t ssize_t;
|
||||
* Current version of the library.
|
||||
* 0x01093001 = 1.9.30-1.
|
||||
*/
|
||||
#define MHD_VERSION 0x00093801
|
||||
#define MHD_VERSION 0x00093802
|
||||
|
||||
/**
|
||||
* MHD-internal return code for "YES".
|
||||
|
||||
@@ -524,9 +524,10 @@ keepalive_possible (struct MHD_Connection *connection)
|
||||
{
|
||||
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))
|
||||
|
||||
Reference in new issue
Block a user