aboutsummaryrefslogtreecommitdiffstats
path: root/net/server_epoll.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-09-20 14:42:18 +0200
committerKim Alvefur <zash@zash.se>2021-09-20 14:42:18 +0200
commit6d5ff6d2be030b9ab133867eca04200923a42fdb (patch)
tree956b9575b85d05e5c159fb47403f0252c91e7dce /net/server_epoll.lua
parent8fe336b4a187f4b8059f3c02e8dad63c1238dcd5 (diff)
downloadprosody-6d5ff6d2be030b9ab133867eca04200923a42fdb.tar.gz
prosody-6d5ff6d2be030b9ab133867eca04200923a42fdb.zip
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.
Diffstat (limited to 'net/server_epoll.lua')
-rw-r--r--net/server_epoll.lua6
1 files changed, 6 insertions, 0 deletions
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