Commit b6a4f0d9 authored by Vladimír Čunát's avatar Vladimír Čunát

Merge !681: various nitpicks, see commits for details

parents 0308c250 c22bff61
Pipeline #41481 passed with stages
in 9 minutes and 34 seconds
......@@ -315,7 +315,8 @@ int cache_peek(kr_layer_t *ctx, knot_pkt_t *pkt)
struct kr_query *qry = req->current_query;
/* We first check various exit-conditions and then call the _real function. */
if (ctx->state & (KR_STATE_FAIL|KR_STATE_DONE) || qry->flags.NO_CACHE
if (!kr_cache_is_open(&req->ctx->cache)
|| ctx->state & (KR_STATE_FAIL|KR_STATE_DONE) || qry->flags.NO_CACHE
|| (qry->flags.CACHE_TRIED && !qry->stale_cb)
|| !check_rrtype(qry->stype, qry) /* LATER: some other behavior for some of these? */
|| qry->sclass != KNOT_CLASS_IN) {
......@@ -358,7 +359,8 @@ int cache_stash(kr_layer_t *ctx, knot_pkt_t *pkt)
/* Note: we cache even in KR_STATE_FAIL. For example,
* BOGUS answer can go to +cd cache even without +cd request. */
if (!qry || qry->flags.CACHED || !check_rrtype(knot_pkt_qtype(pkt), qry)
if (!kr_cache_is_open(cache) || !qry
|| qry->flags.CACHED || !check_rrtype(knot_pkt_qtype(pkt), qry)
|| qry->sclass != KNOT_CLASS_IN) {
return ctx->state;
}
......
......@@ -438,8 +438,8 @@ typedef struct trie_it {
node_t* *stack; /*!< The stack; malloc is used directly instead of mm. */
uint32_t len; /*!< Current length of the stack. */
uint32_t alen; /*!< Allocated/available length of the stack. */
/*! \brief Initial storage for \a stack; it should fit in most use cases. */
node_t* stack_init[2000 / sizeof(node_t *)];
/*! \brief Initial storage for \a stack; it should fit in many use cases. */
node_t* stack_init[60];
} nstack_t;
/*! \brief Create a node stack containing just the root (or empty). */
......
......@@ -121,6 +121,9 @@ trie_it_t* trie_it_begin(trie_t *tbl);
*
* Iteration is in ascending lexicographical order.
* In particular, the empty string would be considered as the very first.
*
* \note You may not use this function if the trie's key-set has been modified
* during the lifetime of the iterator (modifying values only is OK).
*/
KR_EXPORT
void trie_it_next(trie_it_t *it);
......
Root on lookback (RFC 7706)
Root on loopback (RFC 7706)
---------------------------
Knot Resolver developers decided that pure implementation of :rfc:`7706` is a bad idea so it is not implemented in the form envisioned by the RFC. You can get the very similar effect without its downsides by combining :ref:`prefill <mod-prefill>` and :ref:`serve_stale <mod-serve_stale>` modules with Aggressive Use of DNSSEC-Validated Cache (:rfc:`8198`) behavior which is enabled automatically together with DNSSEC validation.
Markdown is supported
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