libmicrohttpd
[Top][All Lists]
Advanced

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

Re: [libmicrohttpd] Server side force connection close.


From: Christian Grothoff
Subject: Re: [libmicrohttpd] Server side force connection close.
Date: Tue, 15 Nov 2011 18:03:48 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20111004 Lightning/1.0b1 Icedove/3.0.11

If you look at MHD_connection_handle_idle for the case of MHD_CONNECTION_FOOTERS_RECEIVED, you will see that MHD tests if you (or the browser) added 'Connection: close' and if so, MHD *will* close the TCP connection.

So adding a 'Connection: Close' header not only tells the browser to not re-use the connection -- MHD will also enforce the protocol in that case.

Please let me know if this is not working for you for any reason.

Happy hacking,

Christian

On 11/15/2011 05:53 PM, Bent Bisballe Nyeng wrote:
Hi List.

Is it possible to force close of a connection from the server after the
reply has been sent.
Setting a 'Connection: Close' header in the reply is not sufficient
since not all clients can be relied upon to actually close their
connections when encountering this header.
In my case I have a accept-one-connection-at-the-time server that must
not be blocked by clients not correctly shutting down their conenctions
after getting their replies.

Kind regards
Bent Bisballe Nyeng





reply via email to

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