Well, I'm pretty sure there is nothing _wrong_ about your code. The MHD
API doesn't actually specify whether it will call you one last time
before the timeout, but what happens right now is that the timeout
triggers the select() to unblock, and MHD goes over all "pending"
connections, and _afterwards_ collects those that have timed out. We
_may_ change that behavior in the future (not that I have specific
plans), so you probably shouldn't rely upon it.

My 2 cents

Christian

On 10/06/2017 06:14 PM, Decebal Epuran wrote:
> I am developing a web server that mainly handles POST requests (json).
> I'm getting the "final call" (*upload_data_size == 0) when all the POST
> data is transfered to my buffer and I'm ready to parse the json data and
> do additional work before send the reply.
> If I'm going over the timeout limit (MHD_OPTION_CONNECTION_TIMEOUT)
> without sending any reply I'm getting another "final call"
> (*upload_data_size == 0) before the MHD_OPTION_NOTIFY_COMPLETED call.
> Is this behavior by design or something is not right in my code?
> 
> Thanks

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to