]> git.ipfire.org Git - thirdparty/knot-resolver.git/commit
lib/cache: simplify logic for qry->flags.CACHE_TRIED
authorVladimír Čunát <vladimir.cunat@nic.cz>
Mon, 7 Jul 2025 12:00:27 +0000 (14:00 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Wed, 16 Jul 2025 16:48:29 +0000 (18:48 +0200)
commit726a3bdc098a43d469b6864143d70e4872367b97
treefa176114c03ed71fb8865bc7a14ed09ae68b2ede
parentcf40b6b80f4396972a5afeff17176fd029c79507
lib/cache: simplify logic for qry->flags.CACHE_TRIED

As a side effect, this solves an issue which could be seen
during resolver startup where the trust anchor update would fail.
[taupd ] active refresh failed for . with rcode: 2

The cause is that for queries started with .flags.NO_CACHE,
we'd skip the section setting .flags.CACHE_TRIED, and consequently
kr_rule_local_data_answer() would get run more often than expected.

The new logic should be also much simpler to follow.
We always apply cache (and policy) just once per kr_query.
lib/cache/api.c