]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
lib/rplan: remember request context in each query
authorMarek Vavruša <mvavrusa@cloudflare.com>
Mon, 27 Nov 2017 22:59:55 +0000 (14:59 -0800)
committerMarek Vavruša <mvavrusa@cloudflare.com>
Sat, 2 Dec 2017 02:50:20 +0000 (18:50 -0800)
This doesn't affect any of the objects lifetime, just provides a
convenience for logging as some subsystems take only pointer of queries
not the request object.

lib/rplan.c
lib/rplan.h

index e9de8a9cd69d8993174054eb1d4d24607b449a5e..4069a8cc598399a693531606d2ed1a6c677bb7bb 100644 (file)
@@ -151,6 +151,7 @@ static struct kr_query *kr_rplan_push_query(struct kr_rplan *rplan,
        /* Class and type must be set outside this function. */
        qry->flags = rplan->request->options;
        qry->parent = parent;
+       qry->request = rplan->request;
        qry->ns.ctx = rplan->request->ctx;
        qry->ns.addr[0].ip.sa_family = AF_UNSPEC;
        gettimeofday(&qry->timestamp, NULL);
index 9a0998474aa6b55e5207cbcf9bc7a147fc91adbf..04e8f9cd347ce44287572a63641b9c180c683279 100644 (file)
@@ -93,6 +93,7 @@ struct kr_query {
        uint32_t uid; /**< Query iteration number, unique within the kr_rplan. */
        /** Pointer to the query that originated this one because of following a CNAME (or NULL). */
        struct kr_query *cname_parent;
+       struct kr_request *request; /**< Parent resolution request. */
 };
 
 /** @cond internal Array of queries. */