libmicrohttpd
[Top][All Lists]
Advanced

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

Re: [libmicrohttpd] call_connection_handler (connection); /* "final" cal


From: Christian Grothoff
Subject: Re: [libmicrohttpd] call_connection_handler (connection); /* "final" call */ is called twice
Date: Fri, 6 Oct 2017 19:49:23 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0

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

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