diff options
author | Kim Alvefur <zash@zash.se> | 2016-08-22 17:20:54 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2016-08-22 17:20:54 +0200 |
commit | 71b2c42271c57a45d77a77a0cda536ce49509641 (patch) | |
tree | 961f0dd866a956ecdd96b284e3db2ae79fe54921 /net/server_epoll.lua | |
parent | f042a31e6c777161bb5ff4ec0c00c6684d4063b7 (diff) | |
download | prosody-71b2c42271c57a45d77a77a0cda536ce49509641.tar.gz prosody-71b2c42271c57a45d77a77a0cda536ce49509641.zip |
net.server_epoll: Tailcalls
Diffstat (limited to 'net/server_epoll.lua')
-rw-r--r-- | net/server_epoll.lua | 11 |
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 |