From: Grigorii Demidov Date: Fri, 20 Jan 2017 10:26:43 +0000 (+0100) Subject: modules/policy: set QTRACE flag for current query too X-Git-Tag: v1.2.0-rc3~3^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d1d2a13370fd10e62aedd5e604103aa6dee4efff;p=thirdparty%2Fknot-resolver.git modules/policy: set QTRACE flag for current query too --- diff --git a/lib/layer/iterate.c b/lib/layer/iterate.c index f72468761..badf3958a 100644 --- a/lib/layer/iterate.c +++ b/lib/layer/iterate.c @@ -754,12 +754,14 @@ static int resolve(kr_layer_t *ctx, knot_pkt_t *pkt) if (!query) { return ctx->state; } -#ifndef NDEBUG + +#ifndef NDEBUG /* These might be useful during debugging. */ if (query->flags & QUERY_TRACE) { VERBOSE_MSG("<= answer received:\n"); kr_pkt_print(pkt); } #endif + if (query->flags & (QUERY_RESOLVED|QUERY_BADCOOKIE_AGAIN)) { return ctx->state; } diff --git a/modules/policy/policy.lua b/modules/policy/policy.lua index 57fdacfaa..e5d020a6d 100644 --- a/modules/policy/policy.lua +++ b/modules/policy/policy.lua @@ -229,7 +229,9 @@ function policy.enforce(state, req, action) return kres.DONE end elseif action == policy.QTRACE then + local qry = req:current() req.options = bit.bor(req.options, kres.query.TRACE) + qry.flags = bit.bor(qry.flags, kres.query.TRACE) elseif type(action) == 'function' then return action(state, req) end