From: Vladimír Čunát Date: Wed, 28 Nov 2018 10:14:53 +0000 (+0100) Subject: lib/resolve: fix build with -DNOVERBOSELOG X-Git-Tag: v3.2.0~23^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a027206d953d6c984b0911af62d0481d41147ba4;p=thirdparty%2Fknot-resolver.git lib/resolve: fix build with -DNOVERBOSELOG Fixes #424. --- diff --git a/NEWS b/NEWS index a2fbd6f14..b1ac30248 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,7 @@ Bugfixes -------- - http module: only run prometheus in parent process if using --forks=N, as the submodule collects metrics from all sub-processes as well. +- fix build with -DNOVERBOSELOG (#424) Improvements ------------ diff --git a/lib/resolve.c b/lib/resolve.c index dfb880ba8..800f8f4ae 100644 --- a/lib/resolve.c +++ b/lib/resolve.c @@ -1607,10 +1607,6 @@ int kr_resolve_checkout(struct kr_request *request, const struct sockaddr *src, int kr_resolve_finish(struct kr_request *request, int state) { -#ifndef NOVERBOSELOG - struct kr_rplan *rplan = &request->rplan; -#endif - /* Finalize answer and construct wire-buffer. */ ITERATE_LAYERS(request, NULL, answer_finalize); if (request->state == KR_STATE_FAIL) { @@ -1632,9 +1628,12 @@ int kr_resolve_finish(struct kr_request *request, int state) request->state = state; ITERATE_LAYERS(request, NULL, finish); +#ifndef NOVERBOSELOG + struct kr_rplan *rplan = &request->rplan; struct kr_query *last = kr_rplan_last(rplan); VERBOSE_MSG(last, "finished: %d, queries: %zu, mempool: %zu B\n", request->state, rplan->resolved.len, (size_t) mp_total_size(request->pool.ctx)); +#endif /* Trace request finish */ if (request->trace_finish) {