aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-08-12 01:11:59 +0200
committerKim Alvefur <zash@zash.se>2016-08-12 01:11:59 +0200
commit488af5f9a8904b4304cb90a38526cc8160bf89ff (patch)
tree26ad66d684537902bd4f4b7c85ac2e04b279999e /net
parenta590be3b188d3d27ae7cd434a74ccf258a635e21 (diff)
downloadprosody-488af5f9a8904b4304cb90a38526cc8160bf89ff.tar.gz
prosody-488af5f9a8904b4304cb90a38526cc8160bf89ff.zip
net.server_epoll: Replace any previous pausefor timer
Diffstat (limited to 'net')
-rw-r--r--net/server_epoll.lua11
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()