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

layer/*cache: lookup only on first iteration

parent 12552eb3
Branches
Tags
No related merge requests found
......@@ -105,7 +105,10 @@ static int peek(knot_layer_t *ctx, knot_pkt_t *pkt)
struct kr_rplan *rplan = &req->rplan;
struct kr_query *qry = kr_rplan_current(rplan);
if (!qry || ctx->state & (KNOT_STATE_DONE|KNOT_STATE_FAIL)) {
return ctx->state;
return ctx->state; /* Already resolved/failed */
}
if (!(qry->flags & QUERY_AWAIT_CUT)) {
return ctx->state; /* Only lookup on first iteration */
}
if (knot_pkt_qclass(pkt) != KNOT_CLASS_IN) {
return ctx->state; /* Only IN class */
......
......@@ -90,7 +90,10 @@ static int peek(knot_layer_t *ctx, knot_pkt_t *pkt)
struct kr_rplan *rplan = &req->rplan;
struct kr_query *qry = kr_rplan_current(rplan);
if (!qry || ctx->state & (KNOT_STATE_FAIL|KNOT_STATE_DONE)) {
return ctx->state;
return ctx->state; /* Already resolved/failed */
}
if (!(qry->flags & QUERY_AWAIT_CUT)) {
return ctx->state; /* Only lookup on first iteration */
}
struct kr_cache_txn txn;
......
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