diff options
author | Kim Alvefur <zash@zash.se> | 2019-12-08 14:20:56 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2019-12-08 14:20:56 +0100 |
commit | 654d9817ad2211686f3d25d79a72cfe9266f8b58 (patch) | |
tree | bd1bcd255e539f35a6381d5cf528752c24c87bbf /net | |
parent | 158be3a8f16ff6f713d216e450e23a23e1f577b2 (diff) | |
download | prosody-654d9817ad2211686f3d25d79a72cfe9266f8b58.tar.gz prosody-654d9817ad2211686f3d25d79a72cfe9266f8b58.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.lua | 5 |
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"); |