# HG changeset patch # User Kim Alvefur # Date 1632302875 -7200 # Node ID 790bffbb9047924996fdfefa3cbf5b73fd128885 # Parent 42e98179c0344ab38f124f3fd58ceb64583a4228 net.server_epoll: Skip attempt to flush write buffer when not connected Before 22825cb5dcd8 connection attempts that failed (e.g. connection refused) would be immediately destroyed. After, it would schedule another write cycle and then report 'ondisconnect' again when failing. Thanks Martin for reporting diff -r 42e98179c034 -r 790bffbb9047 net/server_epoll.lua --- a/net/server_epoll.lua Mon Sep 20 15:51:43 2021 +0200 +++ b/net/server_epoll.lua Wed Sep 22 11:27:55 2021 +0200 @@ -573,7 +573,7 @@ -- Close, possibly after writing is done function interface:close() - if self.writebuffer and (self.writebuffer[1] or type(self.writebuffer) == "string") then + if self._connected and self.writebuffer and (self.writebuffer[1] or type(self.writebuffer) == "string") then self:set(false, true); -- Flush final buffer contents self:setreadtimeout(false); self:setwritetimeout();