libmicrohttpd
[Top][All Lists]
Advanced

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

[libmicrohttpd] Tiny request


From: Junker, Gregory
Subject: [libmicrohttpd] Tiny request
Date: Wed, 3 Dec 2014 23:30:08 +0000

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


reply via email to

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