diff options
author | Marek Vavruša <mvavrusa@cloudflare.com> | 2017-12-29 04:23:22 +0100 |
---|---|---|
committer | Marek Vavruša <marek@vavrusa.com> | 2018-01-08 21:42:32 +0100 |
commit | 8f31e3ac5765b703c329b9a2b633c1c3788fdc63 (patch) | |
tree | 03a959d4300bf0d00d04c46ec3e3db5ac8de9325 /modules/stats/stats.c | |
parent | tests/config: all tests can now be asynchronous with worker.coroutine (diff) | |
download | knot-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 'modules/stats/stats.c')
-rw-r--r-- | modules/stats/stats.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/stats/stats.c b/modules/stats/stats.c index f6173ad0..cff04b24 100644 --- a/modules/stats/stats.c +++ b/modules/stats/stats.c @@ -218,7 +218,7 @@ static int collect(kr_layer_t *ctx) stat_const_add(data, metric_answer_slow, 1); } /* Observe the final query. */ - struct kr_query *last = array_tail(rplan->resolved); + struct kr_query *last = kr_rplan_last(rplan); if (last->flags.CACHED) { stat_const_add(data, metric_answer_cached, 1); } |