aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-02-26 18:31:27 +0100
committerKim Alvefur <zash@zash.se>2018-02-26 18:31:27 +0100
commit60e13b6807f25c4d9222723879ae619e9aedd348 (patch)
treee121365b6334d3e7f64fd45216b000825c6b7211
parent5e69368eeb570c8ddddc1a4775dbc0ac0fe64ecb (diff)
downloadprosody-60e13b6807f25c4d9222723879ae619e9aedd348.tar.gz
prosody-60e13b6807f25c4d9222723879ae619e9aedd348.zip
server_epoll: Onconnect should happen before first attempt to write to socket
-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 47d19350..3ce1be5a 100644
--- a/net/server_epoll.lua
+++ b/net/server_epoll.lua
@@ -334,6 +334,7 @@ end
-- Called when socket is writable
function interface:onwritable()
+ self:onconnect();
local buffer = self.writebuffer;
local data = t_concat(buffer);
local ok, err, partial = self.conn:send(data);
@@ -344,7 +345,6 @@ function interface:onwritable()
end
self:setwritetimeout(false);
self:ondrain(); -- Be aware of writes in ondrain
- self:onconnect();
return;
elseif partial then
buffer[1] = data:sub(partial+1);