# HG changeset patch # User Kim Alvefur # Date 1575811256 -3600 # Node ID 6f7a77aff9d5fbd6f5e9f14e372d00d8c25ebc03 # Parent c9cff02c0528a018018afea79806f1ea21741279 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. diff -r c9cff02c0528 -r 6f7a77aff9d5 net/server_epoll.lua --- a/net/server_epoll.lua Sun Dec 08 13:40:42 2019 +0100 +++ b/net/server_epoll.lua Sun Dec 08 14:20:56 2019 +0100 @@ -86,6 +86,7 @@ end local function reschedule(t, time) + time = gettime() + time; t[1] = time; timers:reprioritize(t.id, time); end @@ -253,7 +254,7 @@ 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 @@ 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");