Skip to content
Snippets Groups Projects
Commit 378b43d7 authored by Marek Vavruša's avatar Marek Vavruša
Browse files

layer/rrcache: cache authority only if chasing referral/cname

parent cc05831d
Branches
Tags
No related merge requests found
......@@ -248,10 +248,15 @@ static int stash(knot_layer_t *ctx, knot_pkt_t *pkt)
stash.malloc = (map_alloc_f) mm_alloc;
stash.free = (map_free_f) mm_free;
stash.baton = rplan->pool;
int ret = stash_authority(qry, pkt, &stash, rplan->pool);
if (ret == 0 && knot_wire_get_aa(pkt->wire)) {
int ret = 0;
bool is_auth = knot_wire_get_aa(pkt->wire);
if (is_auth) {
ret = stash_answer(qry, pkt, &stash, rplan->pool);
}
/* Cache authority only if chasing referral/cname chain */
if (!is_auth || qry != HEAD(rplan->pending)) {
ret = stash_authority(qry, pkt, &stash, rplan->pool);
}
/* Cache stashed records */
if (ret == 0) {
/* Open write transaction */
......
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