aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-08-22 17:20:54 +0200
committerKim Alvefur <zash@zash.se>2016-08-22 17:20:54 +0200
commit6d88b49540cf7d551fb6ef58650e4b86b3106640 (patch)
tree961f0dd866a956ecdd96b284e3db2ae79fe54921 /net
parente98fe5eb0441326e5cb2854b26e8c5cfe33d21f0 (diff)
downloadprosody-6d88b49540cf7d551fb6ef58650e4b86b3106640.tar.gz
prosody-6d88b49540cf7d551fb6ef58650e4b86b3106640.zip
net.server_epoll: Tailcalls
Diffstat (limited to 'net')
-rw-r--r--net/server_epoll.lua11
1 files changed, 6 insertions, 5 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua
index 21a6f785..427f470a 100644
--- a/net/server_epoll.lua
+++ b/net/server_epoll.lua
@@ -479,17 +479,18 @@ function interface:init()
self._tls = false; -- This means we should call onconnect when TLS is up
return self:starttls();
else
- self:setflags(false, true);
- self:setwritetimeout(cfg.connect_timeout);
+ self.onwriteable = interface.onconnect;
+ self:setwritetimeout();
+ return self:setflags(false, true);
end
end
function interface:pause()
- self:setflags(false);
+ return self:setflags(false);
end
function interface:resume()
- self:setflags(true);
+ return self:setflags(true);
end
-- Pause connection for some time
@@ -501,10 +502,10 @@ function interface:pausefor(t)
self:setflags(false);
self._pausefor = addtimer(t, function ()
self._pausefor = nil;
- self:setflags(true);
if self.conn:dirty() then
self:onreadable();
end
+ return self:setflags(true);
end);
end