diff options
author | Tomas Krizek <tomas.krizek@nic.cz> | 2021-11-11 15:12:05 +0100 |
---|---|---|
committer | Tomas Krizek <tomas.krizek@nic.cz> | 2021-12-21 15:02:08 +0100 |
commit | 92a2b671af6a7dcb91600dda854d30f15d80d1da (patch) | |
tree | 3bec8e4b66f6077e23bc236d68a927ae7d0cd0b6 /lib/resolve.c | |
parent | logging: remove QVERBOSE in favor of kr_log_q (diff) | |
download | knot-resolver-92a2b671af6a7dcb91600dda854d30f15d80d1da.tar.xz knot-resolver-92a2b671af6a7dcb91600dda854d30f15d80d1da.zip |
ede: add KNOT_EDNS_EDE_NREACH_AUTH
Diffstat (limited to 'lib/resolve.c')
-rw-r--r-- | lib/resolve.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/lib/resolve.c b/lib/resolve.c index 8897afa2..187d7a22 100644 --- a/lib/resolve.c +++ b/lib/resolve.c @@ -780,16 +780,6 @@ fail: return request->answer = NULL; } -static bool resolution_time_exceeded(struct kr_query *qry, uint64_t now) -{ - uint64_t resolving_time = now - qry->creation_time_mono; - if (resolving_time > KR_RESOLVE_TIME_LIMIT) { - VERBOSE_MSG(qry, "query resolution time limit exceeded\n"); - return true; - } - return false; -} - int kr_resolve_consume(struct kr_request *request, struct kr_transport **transport, knot_pkt_t *packet) { struct kr_rplan *rplan = &request->rplan; @@ -802,7 +792,8 @@ int kr_resolve_consume(struct kr_request *request, struct kr_transport **transpo /* Different processing for network error */ struct kr_query *qry = array_tail(rplan->pending); /* Check overall resolution time */ - if (resolution_time_exceeded(qry, kr_now())) { + if (kr_now() - qry->creation_time_mono >= KR_RESOLVE_TIME_LIMIT) { + kr_query_inform_timeout(request, qry); return KR_STATE_FAIL; } bool tried_tcp = (qry->flags.TCP); |