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
commitcd4065264283a20c1ec1b90443724a5e743604ac (patch)
tree26ad66d684537902bd4f4b7c85ac2e04b279999e /net
parent360563ba3a9ad8141c3fe772f869811400ffabc9 (diff)
downloadprosody-cd4065264283a20c1ec1b90443724a5e743604ac.tar.gz
prosody-cd4065264283a20c1ec1b90443724a5e743604ac.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()