Hi Robert,

I think I understand you goal, and I think you missed the "trick": if
you want to force MHD to close a persistent connection after the current
reply (and the client set keep-alive, it is HTTP/1.1, etc.), what you
should do is explicitly add a "Connection: Close" header to your
response.  MHD will detect that you did this, and will then close the
connection itself.

Alternatively, if you want to hard-close a connection (in violation of
the protocol) at any time, you just need to return "MHD_NO" from the
handler.

Please let me know if this somehow doesn't solve your problem (i.e.
because I didn't understand what you wanted to do).

Happy hacking!

Christian

On 12/01/2015 02:13 PM, Robert Groenenberg wrote:
> Hi Christian,
> 
> In my application I want to be able to close a (persistent) connection
> after completing the current request. For this I had in mind to register
> a callback for the NOTIFY_COMPLETED option.
> When the callback is called and my close flag is set, I wanted to call
> *MHD_connection_close()*.
> Only glitch is that MHD_connection_close() is not in the external API...
> 
> Could it be made part of the external API?
> 
> Kind regards,
> Robert
> 

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to