aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-06-29 16:42:16 +0200
committerKim Alvefur <zash@zash.se>2020-06-29 16:42:16 +0200
commit927ef9f2f233b616d66e736dc19cd7e4d62dfcc7 (patch)
treebd5a0d4a6c15a047abec2eca35d09da34de3fcff /net
parent99b26ab45c54e677762b62cd0a1ca7bd4a6d7380 (diff)
downloadprosody-927ef9f2f233b616d66e736dc19cd7e4d62dfcc7.tar.gz
prosody-927ef9f2f233b616d66e736dc19cd7e4d62dfcc7.zip
net.server_epoll: Make API-compatible with util.timer
Diffstat (limited to 'net')
-rw-r--r--net/server_epoll.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua
index f4c14e13..fbe11401 100644
--- a/net/server_epoll.lua
+++ b/net/server_epoll.lua
@@ -99,9 +99,9 @@ local function reschedule(t, time)
end
-- Add relative timer
-local function addtimer(timeout, f)
+local function addtimer(timeout, f, param)
local time = monotonic() + timeout;
- local timer = { time, f, close = closetimer, reschedule = reschedule, id = nil };
+ local timer = { time, f, param, close = closetimer, reschedule = reschedule, id = nil };
timer.id = timers:insert(timer, time);
return timer;
end
@@ -121,7 +121,7 @@ local function runtimers(next_delay, min_wait)
end
local _, timer = timers:pop();
- local ok, ret = pcall(timer[2], now);
+ local ok, ret = pcall(timer[2], now, timer, timer[3]);
if ok and type(ret) == "number" then
local next_time = elapsed+ret;
timer[1] = next_time;