libmicrohttpd
[Top][All Lists]
Advanced

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

Re: [libmicrohttpd] How to disable the connection keep-alive header?


From: Christian Grothoff
Subject: Re: [libmicrohttpd] How to disable the connection keep-alive header?
Date: Fri, 22 Jan 2016 11:34:00 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.5.0

The way to prevent MHD from automatically setting "Connection:
keep-alive" is to explicitly set "Connection: close".

On 01/22/2016 04:17 AM, silvioprog wrote:
> Hello,
> 
> Sometimes we need to disable the keep-alive header. For example, see this
> headers sent from the Express framework:
> 
> X-Powered-By: Express
> Date: Fri, 22 Jan 2016 02:59:01 GMT
> Content-Type: text/html; charset=utf-8
> Content-Length: 53
> ETag: W/"35-gbcWXekTybZhSQkHA12aAA"
> 
> Wel, just for a test, I tried to disable it on MHD, but it doesn't worked.
> I tried with MHD_del_response_header(response, MHD_HTTP_HEADER_CONNECTION,
> "Keep-Alive") and MHD_del_response_header(response,
> MHD_HTTP_HEADER_CONNECTION, NULL), same problem with both, the connection
> keep-alive header persists.
> 
> So, is the connection keep-alive header sent unconditionally by MHD? If so,
> it should be configured via flags, so the user (programmer) could populate
> all headers from a own list instead of removing it from an already
> populated list by the library, avoiding another loop (eg:
> MHD_del_response_header), increasing performance in the end code.
> 
> Thank you!
> 

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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