summaryrefslogtreecommitdiffstats
path: root/lib/rplan.h
diff options
context:
space:
mode:
authorMarek Vavruša <mvavrusa@cloudflare.com>2017-12-29 04:23:22 +0100
committerMarek Vavruša <marek@vavrusa.com>2018-01-08 21:42:32 +0100
commit8f31e3ac5765b703c329b9a2b633c1c3788fdc63 (patch)
tree03a959d4300bf0d00d04c46ec3e3db5ac8de9325 /lib/rplan.h
parenttests/config: all tests can now be asynchronous with worker.coroutine (diff)
downloadknot-resolver-8f31e3ac5765b703c329b9a2b633c1c3788fdc63.tar.xz
knot-resolver-8f31e3ac5765b703c329b9a2b633c1c3788fdc63.zip
lib: added kr_rplan_last() function to get last processed query
The last processed query is not always resolved (if resolution fails), so previous code returned wrong query in some messages after failure.
Diffstat (limited to 'lib/rplan.h')
-rw-r--r--lib/rplan.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/rplan.h b/lib/rplan.h
index 643661fc..084d7254 100644
--- a/lib/rplan.h
+++ b/lib/rplan.h
@@ -187,6 +187,13 @@ bool kr_rplan_satisfies(struct kr_query *closure, const knot_dname_t *name, uint
KR_EXPORT KR_PURE
struct kr_query *kr_rplan_resolved(struct kr_rplan *rplan);
+/**
+ * Return last query (either currently being solved or last resolved).
+ * This is necessary to retrieve the last query in case of resolution failures (e.g. time limit reached).
+ */
+KR_EXPORT KR_PURE
+struct kr_query *kr_rplan_last(struct kr_rplan *rplan);
+
/** Return query predecessor. */
KR_EXPORT KR_PURE
struct kr_query *kr_rplan_next(struct kr_query *qry);