Hi José, Thanks for the report!
If MHD needs to (re-)run MHD_run() immediately MHD_get_timeout() must return zero timeout.
You don't need to re-run it if no timeout is returned.Zero timeout if connection cleanup is pending was enforced by Christian in version 0.9.73.
See https://lists.gnu.org/archive/html/libmicrohttpd/2021-01/msg00003.htmlLet me know if it doesn't work for you, so we will be able to fix it before the next release.
Function MHD_run_wait() was added for upcoming version 0.9.74, but it does not return flag "need to re-run". MHD_get_timeout() already serves for this purpose.
-- Evgeny On 24.09.2021 19:22, José Bollo wrote:
Hi Evgeny, Seems fixed on my side. I enforced single call of MHD_run. But I added a special treatment to enforce call to MHD_run even if MHD_get_timeout returned a timeout different of zero. This last point was discussed in the ML thread https://lists.gnu.org/archive/html/libmicrohttpd/2020-12/msg00017.html It could be of great advantage that MHD_get_timeout returns valuable value and also to have a version of MHD_run with a timeout (0 in my case) and returning a value indicating if it has to be called again for pending actions. Thank you for your help. Best regards José
OpenPGP_signature
Description: OpenPGP digital signature