[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [libmicrohttpd] Server side force connection close.
From: |
Bent Bisballe Nyeng |
Subject: |
Re: [libmicrohttpd] Server side force connection close. |
Date: |
Wed, 16 Nov 2011 11:48:01 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.15) Gecko/20110405 Lightning/1.0b3pre Thunderbird/3.1.9 |
Thanks for the reply Christian.
The solution you suggested was exactly the one I tried before posting to
this list.
What confused me was the inconsistency between requests using HTTP/1.1
and HTTP/1.0.
(HTTP/1.0 does not default to persistent connections, whereas HTTP/1.1
does.)
Now that I have sorted that out it seem to work as expected.
May the Source be with you.
// Bent
On 11/15/11 18:03, Christian Grothoff wrote:
> 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
>>
>
>