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

modules/policy: set QTRACE flag for current query too

parent 3bdca503
Branches
Tags
1 merge request!167TRACE policy
......@@ -746,10 +746,12 @@ static int resolve(kr_layer_t *ctx, knot_pkt_t *pkt)
return ctx->state;
}
#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