[Libwebsockets] lws_service_adjust_timeout & lws_service_flag_pending

Bram Peeters Bram.Peeters at dekimo.com
Mon Mar 15 12:19:23 CET 2021


Hi,

TLDR: In cases where lws_service_adjust_timeout returns 0, should lws_service_flag_pending always return a nonzero value (set forced = 1)?

I get a zero from lws_service_adjust_timeout  because of __lws_sul_service_ripe returning a time < 1000 us (LWS_WITH_EXTERNAL_POLL is set).
And in  lws_service_flag_pending none  of the 2 tested conditions are triggered by the __lws_sul_service_ripe condition so forced stays 0.
Under those conditions, it seems in freertos-service.c , function _lws_plat_service_tsi will use an n that is either the initialization value -1 or the current free heap  value (if the timeout for checking that expired) to determine whether to exit with an error (if errno is not EINTR ,  eg errno=0 in my case) or check up to 'current free heap  value' nb of fd's for servicing.
Since that does not seem to be correct, I take it this means it is unexpected lws_service_flag_pending returns 0 and something is going wrong there (is it always the same condition that should trigger for the __lws_sul_service_ripe case ?)?
Or is the explanation completely different ?

Thanks,
Bram



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20210315/3cdd7a4d/attachment.htm>


More information about the Libwebsockets mailing list