# HG changeset patch # User Kim Alvefur # Date 1470957119 -7200 # Node ID b1b27dedf4cf9d31a69b06d23e19357815c891b7 # Parent 3a2fe8e10eebe2142595d0c0aa74c937f0a114c9 net.server_epoll: Replace any previous pausefor timer diff -r 3a2fe8e10eeb -r b1b27dedf4cf net/server_epoll.lua --- a/net/server_epoll.lua Fri Aug 12 00:25:19 2016 +0200 +++ b/net/server_epoll.lua Fri Aug 12 01:11:59 2016 +0200 @@ -412,10 +412,15 @@ 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()