]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
attempt at removing cycles and leaks in the async resolution
authorŠtěpán Balážik <stepan.balazik@nic.cz>
Thu, 10 Sep 2020 11:36:41 +0000 (13:36 +0200)
committerŠtěpán Balážik <stepan.balazik@nic.cz>
Thu, 15 Oct 2020 11:22:22 +0000 (13:22 +0200)
daemon/worker.c
lib/rplan.h

index 0ca5d100cf1ca878e0c8ac30efef4256620affda..741a2a382b273f088385d54e5b1e92f1f4e96fac 100644 (file)
@@ -277,8 +277,13 @@ static inline bool is_tcp_waiting(struct sockaddr *address) {
 void async_ns_resolution(knot_dname_t *name, enum knot_rr_type type) {
        struct kr_qflags flags;
        memset(&flags, 0, sizeof(struct kr_qflags));
+       flags.IS_ASYNC_NS = true;
        knot_pkt_t* pkt = worker_resolve_mk_pkt_dname(name, type, KNOT_CLASS_IN, &flags);
-       worker_resolve_start(pkt, flags);
+       struct qr_task *task = worker_resolve_start(pkt, flags);
+       if (task) {
+               task->ctx->req.options.IS_ASYNC_NS = true;
+               worker_resolve_exec(task, pkt);
+       }
        free(pkt);
 }
 
index 4690daf054958f44c65de9f5dfa5328b7b464d42..5f508ae4e0b4c47053fe26a8671a863b03a4aaeb 100644 (file)
@@ -54,6 +54,7 @@ struct kr_qflags {
        bool NO_NS_FOUND : 1;    /**< No valid NS found during last PRODUCE stage. */
        bool PKT_IS_SANE : 1;    /**< Set by iterator in consume phase to indicate whether
                                  * some basic aspects of the packet are OK, e.g. QNAME. */
+       bool IS_ASYNC_NS : 1;    /**< Request is a async NS resolution for server selection */
 };
 
 /** Combine flags together.  This means set union for simple flags. */