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
commit42eec26103c3030ca4f597d4d10f5af59d5bd909 (patch)
treee121365b6334d3e7f64fd45216b000825c6b7211
parent653a61753edcf094c9889b2fa4e44e903a8cc63d (diff)
downloadprosody-42eec26103c3030ca4f597d4d10f5af59d5bd909.tar.gz
prosody-42eec26103c3030ca4f597d4d10f5af59d5bd909.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);