From 60e13b6807f25c4d9222723879ae619e9aedd348 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Mon, 26 Feb 2018 18:31:27 +0100 Subject: server_epoll: Onconnect should happen before first attempt to write to socket --- net/server_epoll.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'net') 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); -- cgit v1.2.3