]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Only set additionalsNotInCache in the true case
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 13 Oct 2023 13:39:05 +0000 (15:39 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 13 Oct 2023 13:39:05 +0000 (15:39 +0200)
pdns/logging.hh
pdns/recursordist/syncres.cc

index 0ddf6beae11280c2a6655c1622fbb1f0417befbf..637e97d67ee6ba590bf60c8b6698c431e290ac58 100644 (file)
@@ -203,14 +203,14 @@ extern bool g_slogStructured;
 //      startupLog->error("No such file", "Unable to parse configuration file", "config_file", Logging::Loggable(configname));
 //
 #define SLOG(oldStyle, slogCall) \
-  do {                           \
+  if (true) {                    \
     if (g_slogStructured) {      \
       slogCall;                  \
     }                            \
     else {                       \
       oldStyle;                  \
     }                            \
-  } while (0);
+  }
 
 #else // No structured logging (e.g. auth)
 #define SLOG(oldStyle, slogCall) \
index 229db97412f3afa438edaed10fd2e74c7a1ccbdb..f7c56a4e21e5432b264d3096a31a976b2b0056ea 100644 (file)
@@ -620,7 +620,9 @@ void SyncRes::resolveAdditionals(const DNSName& qname, QType qtype, AdditionalMo
       }
     }
     // Not found in cache, check negcache and push task if also not in negcache
-    additionalsNotInCache = pushResolveIfNotInNegCache(qname, qtype, d_now);
+    if (pushResolveIfNotInNegCache(qname, qtype, d_now)) {
+      additionalsNotInCache = true;
+    }
     break;
   }
   case AdditionalMode::Ignore: