It's trivial to add this simple pointer,
and it will tremendously help with the following commit.
engine_deinit(engine);
return ret;
}
+ the_resolver = &engine->resolver;
/* Initialize network */
network_init(&engine->net, uv_default_loop(), TCP_BACKLOG_DEFAULT);
for (size_t i = 0; i < engine->modules.len; ++i) {
engine_unload(engine, engine->modules.at[i]);
}
+ the_resolver = NULL;
kr_zonecut_deinit(&engine->resolver.root_hints);
kr_cache_close(&engine->resolver.cache);
#define VERBOSE_MSG(qry, ...) kr_log_q((qry), RESOLVER, __VA_ARGS__)
+struct kr_context *the_resolver = NULL;
+
bool kr_rank_check(uint8_t rank)
{
switch (rank & ~KR_RANK_AUTH) {
knot_mm_t *pool;
};
+/** Pointer to the singleton resolver context. NULL if not initialized */
+KR_EXPORT extern struct kr_context *the_resolver;
+
/* Kept outside, because kres-gen.lua can't handle this depth
* (and lines here were too long anyway). */
struct kr_request_qsource_flags {