aboutsummaryrefslogtreecommitdiffstats
path: root/net/server_epoll.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-09-22 11:27:55 +0200
committerKim Alvefur <zash@zash.se>2021-09-22 11:27:55 +0200
commit7e8a3af45fd5448056ff016ddb171b20e791c43b (patch)
tree0152a53c521557746705498e8f5e9e2bf76014c5 /net/server_epoll.lua
parentda8329037d6ee0cd1514437cd9c5ac1e73188027 (diff)
downloadprosody-7e8a3af45fd5448056ff016ddb171b20e791c43b.tar.gz
prosody-7e8a3af45fd5448056ff016ddb171b20e791c43b.zip
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
Diffstat (limited to 'net/server_epoll.lua')
-rw-r--r--net/server_epoll.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua
index 90d3929f..ec2dd5b8 100644
--- a/net/server_epoll.lua
+++ b/net/server_epoll.lua
@@ -573,7 +573,7 @@ interface.send = interface.write;
-- 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();