aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-08-23 20:01:02 +0200
committerKim Alvefur <zash@zash.se>2016-08-23 20:01:02 +0200
commit1fdfd19e4f4717ab530e3a2166e65011f596165b (patch)
tree579aa3402aa078ad4e1800c4896db7fd9a6376c7 /net
parent25d455bd211502823610e00f2a0824817125a9c8 (diff)
downloadprosody-1fdfd19e4f4717ab530e3a2166e65011f596165b.tar.gz
prosody-1fdfd19e4f4717ab530e3a2166e65011f596165b.zip
net.server_epoll: Return early in the event of zero timers
Diffstat (limited to 'net')
-rw-r--r--net/server_epoll.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/server_epoll.lua b/net/server_epoll.lua
index a6d97500..afc3f551 100644
--- a/net/server_epoll.lua
+++ b/net/server_epoll.lua
@@ -65,6 +65,11 @@ end
-- Run callbacks of expired timers
-- Return time until next timeout
local function runtimers(next_delay)
+ -- Any timers at all?
+ if not timers[1] then
+ return next_delay;
+ end
+
if resort_timers then
-- Sort earliest timers to the end
t_sort(timers, function (a, b) return a[1] > b[1]; end);