Software /
code /
prosody
Comparison
net/server_epoll.lua @ 11810:fe0cdbad19c3 0.11
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.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 20 Sep 2021 14:42:18 +0200 |
parent | 11751:a8c9a78c6a4b |
child | 11811:ae43166fe931 |
comparison
equal
deleted
inserted
replaced
11809:49cfd3628d9d | 11810:fe0cdbad19c3 |
---|---|
741 -- Signal main loop about shutdown via above upvalue | 741 -- Signal main loop about shutdown via above upvalue |
742 local function setquitting(quit) | 742 local function setquitting(quit) |
743 if quit then | 743 if quit then |
744 quitting = "quitting"; | 744 quitting = "quitting"; |
745 closeall(); | 745 closeall(); |
746 addtimer(1, function () | |
747 if quitting then | |
748 closeall(); | |
749 return 1; | |
750 end | |
751 end); | |
746 else | 752 else |
747 quitting = nil; | 753 quitting = nil; |
748 end | 754 end |
749 end | 755 end |
750 | 756 |