From: Vladimír Čunát Date: Mon, 5 Dec 2022 13:38:45 +0000 (+0100) Subject: policy.DEBUG_IF: don't trigger .REQTRACE unconditionally X-Git-Tag: v5.6.0~10^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=625b8d621fe5ae7e4486225f7360e9dbb0f66509;p=thirdparty%2Fknot-resolver.git policy.DEBUG_IF: don't trigger .REQTRACE unconditionally I broke this in 54ab3f78 or closely around, so this never worked well since 5.4.1, and maybe structured logging (5.4.0) had related issues. --- diff --git a/NEWS b/NEWS index 99e5f49f5..59526db78 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,10 @@ Improvements ------------ - depend on jemalloc, preferably, to improve memory usage (!1353) +Bugfixes +-------- +- policy.DEBUG_IF: don't print client's packet unconditionally (!1366) + Knot Resolver 5.5.3 (2022-09-21) ================================ diff --git a/modules/policy/policy.lua b/modules/policy/policy.lua index 4eba7494e..47e436f02 100644 --- a/modules/policy/policy.lua +++ b/modules/policy/policy.lua @@ -781,6 +781,7 @@ function policy.DEBUG_IF(test) local debug_finish_cb = ffi.cast('trace_callback_f', function (cbreq) jit.off(true, true) -- JIT for (C -> lua)^2 nesting isn't allowed if test(cbreq) then + policy.REQTRACE(nil, cbreq) debug_logfinish_cb(cbreq) -- unconditional version local stash = cbreq:vars()['policy_debug_stash'] @@ -797,7 +798,6 @@ function policy.DEBUG_IF(test) req:vars()['policy_debug_stash'] = {} policy.QTRACE(state, req) req:trace_chain_callbacks(debug_stashlog_cb, debug_finish_cb) - policy.REQTRACE(state, req) return end end