From ba030ad760bfafb2dc705317925fac4b28430069 Mon Sep 17 00:00:00 2001 From: Lonny Wong Date: Fri, 17 Nov 2023 00:58:08 +0800 Subject: [PATCH] libuv: fix idle being stopped when there is still pending stuff https://github.com/warmcat/libwebsockets/pull/3008 --- lib/event-libs/libuv/libuv.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/event-libs/libuv/libuv.c b/lib/event-libs/libuv/libuv.c index dad371aac..e213b8dd9 100644 --- a/lib/event-libs/libuv/libuv.c +++ b/lib/event-libs/libuv/libuv.c @@ -82,8 +82,9 @@ lws_uv_idle(uv_idle_t *handle uv_timer_start(&pt_to_priv_uv(pt)->sultimer, lws_uv_sultimer_cb, LWS_US_TO_MS((uint64_t)us), 0); - /* there is nobody who needs service forcing, shut down idle */ - uv_idle_stop(handle); + /* if there is nobody who needs service forcing, shut down idle */ + if (lws_service_adjust_timeout(pt->context, 1, pt->tid)) + uv_idle_stop(handle); lws_pt_unlock(pt); lws_context_unlock(pt->context);