Skip to content
Snippets Groups Projects
Commit d1d2a133 authored by Grigorii Demidov's avatar Grigorii Demidov
Browse files

modules/policy: set QTRACE flag for current query too

parent 60bcf9ac
Branches
Tags
1 merge request!167TRACE policy
......@@ -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;
}
......
......@@ -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
......
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