From 532fbe06878da9f0b10816be662f6aa7463b8f84 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 31 Oct 2020 00:33:29 +0100 Subject: net.server_epoll: Ensure timeout after closing This should make sure that if there's data left to be written when closing a connection, there's also a timeout so that it doesn't wait forever. --- net/server_epoll.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'net') diff --git a/net/server_epoll.lua b/net/server_epoll.lua index 25a50373..6618c204 100644 --- a/net/server_epoll.lua +++ b/net/server_epoll.lua @@ -514,6 +514,7 @@ interface.send = interface.write; function interface:close() if self.writebuffer and self.writebuffer[1] then self:set(false, true); -- Flush final buffer contents + self:setwritetimeout(); self.write, self.send = noop, noop; -- No more writing self:debug("Close after writing remaining buffered data"); self.ondrain = interface.close; -- cgit v1.2.3