From 6d5ff6d2be030b9ab133867eca04200923a42fdb Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Mon, 20 Sep 2021 14:42:18 +0200 Subject: net.server_epoll: Close sockets added after shutdown signal (fixes #1670) This should ensure that sockets get closed even if they are added after the quit signal. Otherwise they may keep the server alive. --- net/server_epoll.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net/server_epoll.lua b/net/server_epoll.lua index 1abdc4a4..ae9808ad 100644 --- a/net/server_epoll.lua +++ b/net/server_epoll.lua @@ -743,6 +743,12 @@ local function setquitting(quit) if quit then quitting = "quitting"; closeall(); + addtimer(1, function () + if quitting then + closeall(); + return 1; + end + end); else quitting = nil; end -- cgit v1.2.3