libmicrohttpd
[Top][All Lists]
Advanced

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

Re: [libmicrohttpd] issue with suspend/resume


From: Evgeny Grin
Subject: Re: [libmicrohttpd] issue with suspend/resume
Date: Thu, 11 May 2017 15:49:43 +0300
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

On 11.05.2017 15:26, José Bollo wrote:
> First, I just tried the latest commit
> (787bfd1859db22c58271f287dfcb505c0052edd3): Do not add any "Connection"
> headers for "upgrade" connections.
> 
> My issue was still here but...

Strange, resuming connection are now resumed before any other processing.
Are you sure that there are no difference at all?


>> "At least one time" - correct approach.
>> May be more calls are required.
> 
> But there is no way to get a status "should MHD_run be called again?".
> Oh "MHD_get_timeout" is maybe the answer! Does it return 0 in case of
> "loop again please"? It seems that yes.
> 
> Test...
> 
> Works by replacing MHD_run(h) by
> 
>  do { MHD_run(h); } while(MHD_get_timeout(h, &to) == MHD_YES && !to);
> 
> To be honest, I was not handling the timeout because I had no idea that
> it had to drive a such loop. I was thinking it wasn't usefull when
> external epoll was used. I'm not sure to need it for something
> different of the above loop, detecting lazy transmitters can be treated
> lazyly IMHO.

Zero timeout means "need more immediately processing", for example if
more data is still waiting in network buffers.
No-zero timeouts usually generated when you set connection timeout so
MHD is able to close timed-out connections.

--
Wishes,
Evgeny

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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