libmicrohttpd
[Top][All Lists]
Advanced

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

Re: [libmicrohttpd] Regarding Flow control


From: Christian Grothoff
Subject: Re: [libmicrohttpd] Regarding Flow control
Date: Tue, 18 Sep 2018 13:07:31 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

On 09/18/2018 12:23 PM, Kunal Ekawde wrote:
> Thanks Christian,
> So as a solution we need to have a timer for such cases and on timer
> expiry , resume the connection post which as data is not available,
> either error respond or close connection.

Yes, basically if you suspend to perform some asynchronous activity that
needs a timeout, you need to manage that timeout.

> If we close the connection, we
> shall loose the pending requests on that connection right ?

Yes, if you "close" i.e. by returning "MHD_NO".

> and if we
> error respond, we shall get pending messages on that connection right
> (number of pending messages would depend on
> MHD_OPTION_CONNECTION_MEMORY_LIMIT?)?

If you respond, other requests on the connection will then be processed,
but not limited by the MEMORY_LIMIT.  MHD won't use more RAM per
connection than allowed by MEMORY_LIMIT, but the OSes for client and
server negotiate a TCP buffer which is really what limits network
transmissions.  And the client just won't be able to transmit more
requests than what that TCP buffer allows until you resume, but in
theory the number of requests that can be pipelined is unlimited.

> If the case was client side disconnection, post resume, we should get
> notify callback with reason 'MHD_REQUEST_TERMINATED_WITH_ERROR' ? so we
> can do cleanup right ?

Yes.

Attachment: 0x939E6BE1E29FC3CC.asc
Description: application/pgp-keys

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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