diff options
author | Kim Alvefur <zash@zash.se> | 2016-08-12 01:11:59 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2016-08-12 01:11:59 +0200 |
commit | 488af5f9a8904b4304cb90a38526cc8160bf89ff (patch) | |
tree | 26ad66d684537902bd4f4b7c85ac2e04b279999e | |
parent | a590be3b188d3d27ae7cd434a74ccf258a635e21 (diff) | |
download | prosody-488af5f9a8904b4304cb90a38526cc8160bf89ff.tar.gz prosody-488af5f9a8904b4304cb90a38526cc8160bf89ff.zip |
net.server_epoll: Replace any previous pausefor timer
-rw-r--r-- | net/server_epoll.lua | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua index c6778e2b..66d9841c 100644 --- a/net/server_epoll.lua +++ b/net/server_epoll.lua @@ -412,10 +412,15 @@ function interface:resume() end function interface:pausefor(t) - if self._wantread then - self:setflags(false); - addtimer(t, function () self:setflags(true); end); + if self._pausefor then + self._pausefor:close(); end + if t == false then return; end + self:setflags(false); + self._pausefor = addtimer(t, function () + self._pausefor = nil; + self:setflags(true); + end); end function interface:onconnect() |