Skip to content
Snippets Groups Projects
Verified Commit 6091c024 authored by Petr Špaček's avatar Petr Špaček Committed by Tomas Krizek
Browse files

daf: fix consensus() function to correctly detect empty answers

consensus() function is affected by
https://gitlab.labs.nic.cz/knot/knot-resolver/issues/554
so this fix helps only with single-instance scenarios.
parent d1ba9887
Branches
Tags v5.3.0
1 merge request!966daf and HTTP fixes
......@@ -214,9 +214,13 @@ function M.enable(id)
end
local function consensus(op, ...)
local ret = true
local ret = false
local results = map(string.format(op, ...))
for _, r in ipairs(results) do
for idx, r in ipairs(results) do
if idx == 1 then
-- non-empty table, init to true
ret = true
end
ret = ret and r
end
return ret
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment