]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
lib/resolve: fix build with -DNOVERBOSELOG
authorVladimír Čunát <vladimir.cunat@nic.cz>
Wed, 28 Nov 2018 10:14:53 +0000 (11:14 +0100)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Wed, 28 Nov 2018 10:15:59 +0000 (11:15 +0100)
Fixes #424.

NEWS
lib/resolve.c

diff --git a/NEWS b/NEWS
index a2fbd6f1414b4f5ed31ca31e69d690180f5f2dad..b1ac3024805a18c97f79c2a6d61863e837c5cf46 100644 (file)
--- 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
 ------------
index dfb880ba8925b04953b7a1afd0838faa66ef08b1..800f8f4ae04c1d8f1539a57969e461839d86381a 100644 (file)
@@ -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) {