diff options
author | menakite <29005531+menakite@users.noreply.github.com> | 2024-08-14 19:36:54 +0200 |
---|---|---|
committer | menakite <29005531+menakite@users.noreply.github.com> | 2024-08-19 18:03:59 +0200 |
commit | 39f4b5af72f3aca0174476235f43915477f20adb (patch) | |
tree | 56c975793fb3b54e149159fd88f5a8627f92ac1e /lib | |
parent | Merge !1591: modules/stats add answer.stale (diff) | |
download | knot-resolver-39f4b5af72f3aca0174476235f43915477f20adb.tar.xz knot-resolver-39f4b5af72f3aca0174476235f43915477f20adb.zip |
cache: move setting EDE "Stale Answer" to the the serve_stale module.
It is not guaranteed yet that the request will finish in state DONE.
This prevents other EDE codes from being applied to the request and in
case the request ends in FAIL state it produces a SERVFAIL answer with
EDE "Stale Answer", which is a bit weird.
Move setting EDEs in answer_finalize in the serve_stale module, where
the proper EDE in case of NXDOMAIN is set too.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cache/api.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/cache/api.c b/lib/cache/api.c index 0cd18534..046dae20 100644 --- a/lib/cache/api.c +++ b/lib/cache/api.c @@ -237,9 +237,7 @@ int32_t get_new_ttl(const struct entry_h *entry, const struct kr_query *qry, int res_stale = qry->stale_cb(res, owner, type, qry); if (res_stale >= 0) { VERBOSE_MSG(qry, "responding with stale answer\n"); - /* LATER: Perhaps we could use a more specific Stale - * NXDOMAIN Answer code for applicable responses. */ - kr_request_set_extended_error(qry->request, KNOT_EDNS_EDE_STALE, "6Q6X"); + qry->request->stale_accounted = true; return res_stale; } } |