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
--- 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();