aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-12-08 14:20:56 +0100
committerKim Alvefur <zash@zash.se>2019-12-08 14:20:56 +0100
commitd4c21f9ee5157bfd22de4d01cd97ca8ed2286380 (patch)
treebd1bcd255e539f35a6381d5cf528752c24c87bbf /net
parent516309caeca1b0c74be8d4da5c2494a24587daa4 (diff)
downloadprosody-d4c21f9ee5157bfd22de4d01cd97ca8ed2286380.tar.gz
prosody-d4c21f9ee5157bfd22de4d01cd97ca8ed2286380.zip
net.server_epoll: Change timer rescheduling method to match util.timer
Relative to current time instead of absolute time, in preparation for switching to monotonic time.
Diffstat (limited to 'net')
-rw-r--r--net/server_epoll.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua
index 8af6f484..77619b69 100644
--- a/net/server_epoll.lua
+++ b/net/server_epoll.lua
@@ -86,6 +86,7 @@ local function closetimer(t)
end
local function reschedule(t, time)
+ time = gettime() + time;
t[1] = time;
timers:reprioritize(t.id, time);
end
@@ -253,7 +254,7 @@ function interface:setreadtimeout(t)
end
t = t or cfg.read_timeout;
if self._readtimeout then
- self._readtimeout:reschedule(gettime() + t);
+ self._readtimeout:reschedule(t);
else
self._readtimeout = addtimer(t, function ()
if self:on("readtimeout") then
@@ -279,7 +280,7 @@ function interface:setwritetimeout(t)
end
t = t or cfg.send_timeout;
if self._writetimeout then
- self._writetimeout:reschedule(gettime() + t);
+ self._writetimeout:reschedule(t);
else
self._writetimeout = addtimer(t, function ()
self:debug("Write timeout");