]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Fix a lot of "unused parameter" warnings
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 14 Oct 2024 13:20:16 +0000 (15:20 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 28 Jan 2025 13:37:21 +0000 (14:37 +0100)
31 files changed:
ext/lmdb-safe/lmdb-safe.hh
pdns/dnsdistdist/dnsdist-carbon.cc
pdns/dnsdistdist/dnsdist-console.cc
pdns/dnsdistdist/dnsdist-downstream-connection.hh
pdns/dnsdistdist/dnsdist-healthchecks.cc
pdns/dnsdistdist/dnsdist-kvs.hh
pdns/dnsdistdist/dnsdist-lua-bindings-dnsquestion.cc
pdns/dnsdistdist/dnsdist-lua-ffi.cc
pdns/dnsdistdist/dnsdist-lua-hooks.cc
pdns/dnsdistdist/dnsdist-lua-inspection.cc
pdns/dnsdistdist/dnsdist-lua-web.cc
pdns/dnsdistdist/dnsdist-nghttp2-in.cc
pdns/dnsdistdist/dnsdist-nghttp2.cc
pdns/dnsdistdist/dnsdist-snmp.cc
pdns/dnsdistdist/dnsdist-tcp-downstream.cc
pdns/dnsdistdist/dnsdist-tcp-upstream.hh
pdns/dnsdistdist/dnsdist-tcp.cc
pdns/dnsdistdist/dnsdist-web.cc
pdns/dnsdistdist/dnsdist.cc
pdns/dnsdistdist/doh.cc
pdns/dnsdistdist/doh3.cc
pdns/dnsdistdist/test-dnsdist-connections-cache.cc
pdns/dnsdistdist/test-dnsdist-lua-ffi.cc
pdns/dnsdistdist/test-dnsdist_cc.cc
pdns/dnsdistdist/test-dnsdistdynblocks_hh.cc
pdns/dnsdistdist/test-dnsdistlbpolicies_cc.cc
pdns/dnsdistdist/test-dnsdistluanetwork.cc
pdns/dnsdistdist/test-dnsdistnghttp2-in_cc.cc
pdns/dnsdistdist/test-dnsdistnghttp2_cc.cc
pdns/dnsdistdist/test-dnsdistnghttp2_common.hh
pdns/dnsdistdist/test-dnsdisttcp_cc.cc

index 07e96cffc11b261e4e4b2bb086117860ca910369..0c14a2f1330500eccf17d3691caf05db3b5b45b8 100644 (file)
@@ -594,6 +594,9 @@ private:
       // * so let's go back
     }
 #else /* ifndef DNSDIST */
+    (void)key;
+    (void)data;
+    (void)op;
     return rc;
 #endif
   }
index 66ec734250e4c2d416a7a977c68e3bda4955cb7c..d0dab784fc20811e999be4468969642ddf3df81f 100644 (file)
@@ -367,9 +367,10 @@ void Carbon::run(const std::vector<Carbon::Endpoint>& endpoints)
 }
 #endif /* DISABLE_CARBON */
 
-static time_t s_start = time(nullptr);
+static const time_t s_start = time(nullptr);
 
 uint64_t uptimeOfProcess(const std::string& str)
 {
+  (void)str;
   return time(nullptr) - s_start;
 }
index 1ad865573bab2f5393c1335ec2178014ea1afffd..dc92a02be46bf42bb4bf1b9994c5b40e6885d97d 100644 (file)
@@ -886,6 +886,7 @@ extern "C"
 
   static char** dnsdist_completion_callback(const char* text, int start, int end)
   {
+    (void)end;
     char** matches = nullptr;
     if (start == 0) {
       // NOLINTNEXTLINE(cppcoreguidelines-pro-type-const-cast): readline
index 8d50de369f2efa8f4cd5d3b0e837a591b39e1130..aba6cd23c6473433279175010601b9f49ad32bae 100644 (file)
@@ -62,7 +62,7 @@ public:
       const auto& it = d_downstreamConnections.find(backendId);
       if (it != d_downstreamConnections.end()) {
         /* first scan idle connections, more recent first */
-        auto entry = findUsableConnectionInList(now, freshCutOff, it->second.d_idles, true);
+        auto entry = findUsableConnectionInList(freshCutOff, it->second.d_idles, true);
         if (entry) {
           ++ds->tcpReusedConnections;
           it->second.d_actives.insert(entry);
@@ -70,7 +70,7 @@ public:
         }
 
         /* then scan actives ones, more recent first as well */
-        entry = findUsableConnectionInList(now, freshCutOff, it->second.d_actives, false);
+        entry = findUsableConnectionInList(freshCutOff, it->second.d_actives, false);
         if (entry) {
           ++ds->tcpReusedConnections;
           return entry;
@@ -107,8 +107,8 @@ public:
     idleCutOff.tv_sec -= s_maxIdleTime;
 
     for (auto dsIt = d_downstreamConnections.begin(); dsIt != d_downstreamConnections.end();) {
-      cleanUpList(dsIt->second.d_idles, now, freshCutOff, idleCutOff);
-      cleanUpList(dsIt->second.d_actives, now, freshCutOff, idleCutOff);
+      cleanUpList(dsIt->second.d_idles, freshCutOff, idleCutOff);
+      cleanUpList(dsIt->second.d_actives, freshCutOff, idleCutOff);
 
       if (dsIt->second.d_idles.empty() && dsIt->second.d_actives.empty()) {
         dsIt = d_downstreamConnections.erase(dsIt);
@@ -212,7 +212,7 @@ public:
   }
 
 protected:
-  void cleanUpList(list_t& list, const struct timeval& now, const struct timeval& freshCutOff, const struct timeval& idleCutOff)
+  void cleanUpList(list_t& list, const struct timeval& freshCutOff, const struct timeval& idleCutOff)
   {
     auto& sidx = list.template get<SequencedTag>();
     for (auto connIt = sidx.begin(); connIt != sidx.end();) {
@@ -248,7 +248,7 @@ protected:
     }
   }
 
-  std::shared_ptr<T> findUsableConnectionInList(const struct timeval& now, const struct timeval& freshCutOff, list_t& list, bool removeIfFound)
+  std::shared_ptr<T> findUsableConnectionInList(const struct timeval& freshCutOff, list_t& list, bool removeIfFound)
   {
     auto& sidx = list.template get<SequencedTag>();
     for (auto listIt = sidx.begin(); listIt != sidx.end();) {
@@ -258,7 +258,7 @@ protected:
       }
 
       auto& entry = *listIt;
-      if (isConnectionUsable(entry, now, freshCutOff)) {
+      if (isConnectionUsable(entry, freshCutOff)) {
         entry->setReused();
         // make a copy since the iterator will be invalidated after erasing
         auto result = entry;
@@ -280,7 +280,7 @@ protected:
     return nullptr;
   }
 
-  bool isConnectionUsable(const std::shared_ptr<T>& conn, const struct timeval& now, const struct timeval& freshCutOff)
+  bool isConnectionUsable(const std::shared_ptr<T>& conn, const struct timeval& freshCutOff)
   {
     if (!conn->canBeReused()) {
       return false;
index 7f02b24f76d017729f4c68d4f38770d34e134e91..647cfa23e49f626f52d77068cc8db71645b83268 100644 (file)
@@ -159,17 +159,22 @@ public:
 
   void handleResponse(const struct timeval& now, TCPResponse&& response) override
   {
+    (void)now;
     d_data->d_buffer = std::move(response.d_buffer);
     d_data->d_ds->submitHealthCheckResult(d_data->d_initial, ::handleResponse(d_data));
   }
 
   void handleXFRResponse(const struct timeval& now, TCPResponse&& response) override
   {
+    (void)now;
+    (void)response;
     throw std::runtime_error("Unexpected XFR reponse to a health check query");
   }
 
   void notifyIOError(const struct timeval& now, [[maybe_unused]] TCPResponse&& response) override
   {
+    (void)now;
+    (void)response;
     ++d_data->d_ds->d_healthCheckMetrics.d_networkErrors;
     d_data->d_ds->submitHealthCheckResult(d_data->d_initial, false);
   }
@@ -231,6 +236,7 @@ static void healthCheckUDPCallback(int descriptor, FDMultiplexer::funcparam_t& p
 
 static void healthCheckTCPCallback(int descriptor, FDMultiplexer::funcparam_t& param)
 {
+  (void)descriptor;
   auto data = boost::any_cast<std::shared_ptr<HealthCheckData>>(param);
 
   IOStateGuard ioGuard(data->d_ioState);
index 764a45c35c07532d2cae06b68681b06e426b248e..5672986e82019fdb2ee72081ba31532efb6c1d50 100644 (file)
@@ -160,6 +160,8 @@ public:
   // This requires that the underlying store supports ordered keys, which is true for LMDB but not for CDB, for example.
   virtual bool getRangeValue(const std::string& key, std::string& value)
   {
+    (void)key;
+    (void)value;
     throw std::runtime_error("range-based lookups are not implemented for this Key-Value Store");
   }
   virtual bool reload()
index 8ae0d81704da7d24675b6bac41bf1e87b067d9a6..479b3371919c056628f62cd9319e88e9dcd5fcf9 100644 (file)
@@ -36,13 +36,13 @@ void setupLuaBindingsDNSQuestion(LuaContext& luaCtx)
   /* DNSQuestion */
   /* PowerDNS DNSQuestion compat */
   luaCtx.registerMember<const ComboAddress(DNSQuestion::*)>(
-    "localaddr", [](const DNSQuestion& dnsQuestion) -> ComboAddress { return dnsQuestion.ids.origDest; }, [](DNSQuestion& dnsQuestion, const ComboAddress newLocal) { (void)newLocal; });
+    "localaddr", [](const DNSQuestion& dnsQuestion) -> ComboAddress { return dnsQuestion.ids.origDest; }, [](DNSQuestion& dnsQuestion, const ComboAddress newLocal) { (void)dnsQuestion; (void)newLocal; });
   luaCtx.registerMember<const DNSName(DNSQuestion::*)>(
-    "qname", [](const DNSQuestion& dnsQuestion) -> DNSName { return dnsQuestion.ids.qname; }, [](DNSQuestion& dnsQuestion, const DNSName& newName) { (void)newName; });
+    "qname", [](const DNSQuestion& dnsQuestion) -> DNSName { return dnsQuestion.ids.qname; }, [](DNSQuestion& dnsQuestion, const DNSName& newName) { (void)dnsQuestion; (void)newName; });
   luaCtx.registerMember<uint16_t(DNSQuestion::*)>(
-    "qtype", [](const DNSQuestion& dnsQuestion) -> uint16_t { return dnsQuestion.ids.qtype; }, [](DNSQuestion& dnsQuestion, uint16_t newType) { (void)newType; });
+    "qtype", [](const DNSQuestion& dnsQuestion) -> uint16_t { return dnsQuestion.ids.qtype; }, [](DNSQuestion& dnsQuestion, uint16_t newType) { (void)dnsQuestion; (void)newType; });
   luaCtx.registerMember<uint16_t(DNSQuestion::*)>(
-    "qclass", [](const DNSQuestion& dnsQuestion) -> uint16_t { return dnsQuestion.ids.qclass; }, [](DNSQuestion& dnsQuestion, uint16_t newClass) { (void)newClass; });
+    "qclass", [](const DNSQuestion& dnsQuestion) -> uint16_t { return dnsQuestion.ids.qclass; }, [](DNSQuestion& dnsQuestion, uint16_t newClass) { (void)dnsQuestion;  (void)newClass; });
   luaCtx.registerMember<int(DNSQuestion::*)>(
     "rcode",
     [](const DNSQuestion& dnsQuestion) -> int {
@@ -55,7 +55,7 @@ void setupLuaBindingsDNSQuestion(LuaContext& luaCtx)
       });
     });
   luaCtx.registerMember<const ComboAddress(DNSQuestion::*)>(
-    "remoteaddr", [](const DNSQuestion& dnsQuestion) -> ComboAddress { return dnsQuestion.ids.origRemote; }, [](DNSQuestion& dnsQuestion, const ComboAddress newRemote) { (void)newRemote; });
+    "remoteaddr", [](const DNSQuestion& dnsQuestion) -> ComboAddress { return dnsQuestion.ids.origRemote; }, [](DNSQuestion& dnsQuestion, const ComboAddress newRemote) { (void)dnsQuestion; (void)newRemote; });
   /* DNSDist DNSQuestion */
   luaCtx.registerMember<dnsheader*(DNSQuestion::*)>(
     "dh",
@@ -71,9 +71,9 @@ void setupLuaBindingsDNSQuestion(LuaContext& luaCtx)
   luaCtx.registerMember<uint16_t(DNSQuestion::*)>(
     "len", [](const DNSQuestion& dnsQuestion) -> uint16_t { return dnsQuestion.getData().size(); }, [](DNSQuestion& dnsQuestion, uint16_t newlen) { dnsQuestion.getMutableData().resize(newlen); });
   luaCtx.registerMember<uint8_t(DNSQuestion::*)>(
-    "opcode", [](const DNSQuestion& dnsQuestion) -> uint8_t { return dnsQuestion.getHeader()->opcode; }, [](DNSQuestion& dnsQuestion, uint8_t newOpcode) { (void)newOpcode; });
+    "opcode", [](const DNSQuestion& dnsQuestion) -> uint8_t { return dnsQuestion.getHeader()->opcode; }, [](DNSQuestion& dnsQuestion, uint8_t newOpcode) { (void)dnsQuestion; (void)newOpcode; });
   luaCtx.registerMember<bool(DNSQuestion::*)>(
-    "tcp", [](const DNSQuestion& dnsQuestion) -> bool { return dnsQuestion.overTCP(); }, [](DNSQuestion& dnsQuestion, bool newTcp) { (void)newTcp; });
+    "tcp", [](const DNSQuestion& dnsQuestion) -> bool { return dnsQuestion.overTCP(); }, [](DNSQuestion& dnsQuestion, bool newTcp) { (void)dnsQuestion; (void)newTcp; });
   luaCtx.registerMember<bool(DNSQuestion::*)>(
     "skipCache", [](const DNSQuestion& dnsQuestion) -> bool { return dnsQuestion.ids.skipCache; }, [](DNSQuestion& dnsQuestion, bool newSkipCache) { dnsQuestion.ids.skipCache = newSkipCache; });
   luaCtx.registerMember<std::string(DNSQuestion::*)>(
@@ -379,13 +379,13 @@ void setupLuaBindingsDNSQuestion(LuaContext& luaCtx)
 
   /* LuaWrapper doesn't support inheritance */
   luaCtx.registerMember<const ComboAddress(DNSResponse::*)>(
-    "localaddr", [](const DNSResponse& dnsQuestion) -> ComboAddress { return dnsQuestion.ids.origDest; }, [](DNSResponse& dnsQuestion, const ComboAddress newLocal) { (void)newLocal; });
+    "localaddr", [](const DNSResponse& dnsQuestion) -> ComboAddress { return dnsQuestion.ids.origDest; }, [](DNSResponse& dnsQuestion, const ComboAddress newLocal) { (void)dnsQuestion; (void)newLocal; });
   luaCtx.registerMember<const DNSName(DNSResponse::*)>(
-    "qname", [](const DNSResponse& dnsQuestion) -> DNSName { return dnsQuestion.ids.qname; }, [](DNSResponse& dnsQuestion, const DNSName& newName) { (void)newName; });
+    "qname", [](const DNSResponse& dnsQuestion) -> DNSName { return dnsQuestion.ids.qname; }, [](DNSResponse& dnsQuestion, const DNSName& newName) { (void)dnsQuestion; (void)newName; });
   luaCtx.registerMember<uint16_t(DNSResponse::*)>(
-    "qtype", [](const DNSResponse& dnsQuestion) -> uint16_t { return dnsQuestion.ids.qtype; }, [](DNSResponse& dnsQuestion, uint16_t newType) { (void)newType; });
+    "qtype", [](const DNSResponse& dnsQuestion) -> uint16_t { return dnsQuestion.ids.qtype; }, [](DNSResponse& dnsQuestion, uint16_t newType) { (void)dnsQuestion; (void)newType; });
   luaCtx.registerMember<uint16_t(DNSResponse::*)>(
-    "qclass", [](const DNSResponse& dnsQuestion) -> uint16_t { return dnsQuestion.ids.qclass; }, [](DNSResponse& dnsQuestion, uint16_t newClass) { (void)newClass; });
+    "qclass", [](const DNSResponse& dnsQuestion) -> uint16_t { return dnsQuestion.ids.qclass; }, [](DNSResponse& dnsQuestion, uint16_t newClass) { (void)dnsQuestion; (void)newClass; });
   luaCtx.registerMember<int(DNSResponse::*)>(
     "rcode",
     [](const DNSResponse& dnsQuestion) -> int {
@@ -398,7 +398,7 @@ void setupLuaBindingsDNSQuestion(LuaContext& luaCtx)
       });
     });
   luaCtx.registerMember<ComboAddress(DNSResponse::*)>(
-    "remoteaddr", [](const DNSResponse& dnsQuestion) -> ComboAddress { return dnsQuestion.ids.origRemote; }, [](DNSResponse& dnsQuestion, const ComboAddress newRemote) { (void)newRemote; });
+    "remoteaddr", [](const DNSResponse& dnsQuestion) -> ComboAddress { return dnsQuestion.ids.origRemote; }, [](DNSResponse& dnsQuestion, const ComboAddress newRemote) { (void)dnsQuestion; (void)newRemote; });
   luaCtx.registerMember<dnsheader*(DNSResponse::*)>(
     "dh",
     [](const DNSResponse& dnsResponse) -> dnsheader* {
@@ -413,9 +413,9 @@ void setupLuaBindingsDNSQuestion(LuaContext& luaCtx)
   luaCtx.registerMember<uint16_t(DNSResponse::*)>(
     "len", [](const DNSResponse& dnsQuestion) -> uint16_t { return dnsQuestion.getData().size(); }, [](DNSResponse& dnsQuestion, uint16_t newlen) { dnsQuestion.getMutableData().resize(newlen); });
   luaCtx.registerMember<uint8_t(DNSResponse::*)>(
-    "opcode", [](const DNSResponse& dnsQuestion) -> uint8_t { return dnsQuestion.getHeader()->opcode; }, [](DNSResponse& dnsQuestion, uint8_t newOpcode) { (void)newOpcode; });
+    "opcode", [](const DNSResponse& dnsQuestion) -> uint8_t { return dnsQuestion.getHeader()->opcode; }, [](DNSResponse& dnsQuestion, uint8_t newOpcode) { (void)dnsQuestion; (void)newOpcode; });
   luaCtx.registerMember<bool(DNSResponse::*)>(
-    "tcp", [](const DNSResponse& dnsQuestion) -> bool { return dnsQuestion.overTCP(); }, [](DNSResponse& dnsQuestion, bool newTcp) { (void)newTcp; });
+    "tcp", [](const DNSResponse& dnsQuestion) -> bool { return dnsQuestion.overTCP(); }, [](DNSResponse& dnsQuestion, bool newTcp) { (void)dnsQuestion; (void)newTcp; });
   luaCtx.registerMember<bool(DNSResponse::*)>(
     "skipCache", [](const DNSResponse& dnsQuestion) -> bool { return dnsQuestion.ids.skipCache; }, [](DNSResponse& dnsQuestion, bool newSkipCache) { dnsQuestion.ids.skipCache = newSkipCache; });
   luaCtx.registerMember<std::string(DNSResponse::*)>(
index 54886c6b8d5078d42be25becfca541e5720e9e57..dfee7d356750e093c72b4cbae97f24a872490525 100644 (file)
@@ -729,12 +729,14 @@ static size_t dnsdist_ffi_servers_get_index_from_server(const ServerPolicy::Numb
 
 size_t dnsdist_ffi_servers_list_chashed(const dnsdist_ffi_servers_list_t* list, const dnsdist_ffi_dnsquestion_t* dq, size_t hash)
 {
+  (void)dq;
   auto server = chashedFromHash(list->servers, hash);
   return dnsdist_ffi_servers_get_index_from_server(list->servers, server);
 }
 
 size_t dnsdist_ffi_servers_list_whashed(const dnsdist_ffi_servers_list_t* list, const dnsdist_ffi_dnsquestion_t* dq, size_t hash)
 {
+  (void)dq;
   auto server = whashedFromHash(list->servers, hash);
   return dnsdist_ffi_servers_get_index_from_server(list->servers, server);
 }
@@ -1881,6 +1883,7 @@ void dnsdist_ffi_metric_set(const char* metricName, size_t metricNameLen, double
 
 double dnsdist_ffi_metric_get(const char* metricName, size_t metricNameLen, bool isCounter)
 {
+  (void)isCounter;
   auto result = dnsdist::metrics::getCustomMetric(std::string_view(metricName, metricNameLen), {});
   if (std::get_if<dnsdist::metrics::Error>(&result) != nullptr) {
     return 0.;
index 8bdff2e17ce782f246324fb31def8e2d2fbea51a..1f92e0ccf3c29b3e7a7b6c767e569ff33f60a6c7 100644 (file)
@@ -32,6 +32,7 @@ void clearMaintenanceHooks()
 
 static void setTicketsKeyAddedHook(const LuaContext& context, const TicketsKeyAddedHook& hook)
 {
+  (void)context;
   TLSCtx::setTicketsKeyAddedHook([hook](const std::string& key) {
     try {
       auto lua = g_lua.lock();
index 391f2b32e6e87c714c327f2095226dd2ab928c95..77ee1e2671c250b9bdcb6bd76daaf4db97b209f2 100644 (file)
@@ -1084,9 +1084,9 @@ void setupLuaInspection(LuaContext& luaCtx)
         nowRealTime.tv_nsec -= 1000000000;
       }
 
-      return nowRealTime; }, [](DynBlock& block, [[maybe_unused]] timespec until) {});
+      return nowRealTime; }, []([[maybe_unused]] DynBlock& block, [[maybe_unused]] timespec until) {});
   luaCtx.registerMember<DynBlock, unsigned int>(
-    "blocks", [](const DynBlock& block) { return block.blocks.load(); }, [](DynBlock& block, [[maybe_unused]] unsigned int blocks) {});
+    "blocks", [](const DynBlock& block) { return block.blocks.load(); }, []([[maybe_unused]] DynBlock& block, [[maybe_unused]] unsigned int blocks) {});
   luaCtx.registerMember("action", &DynBlock::action);
   luaCtx.registerMember("warning", &DynBlock::warning);
   luaCtx.registerMember("bpf", &DynBlock::bpf);
index cd7e47f91ed78d0d9715528e502498caa4fb19c2..5785a4c5c2c79cec7063e86ea07685397ee53cde 100644 (file)
@@ -38,31 +38,31 @@ void setupLuaWeb(LuaContext& luaCtx)
     dnsdist::webserver::registerWebHandler(path, [handler](const YaHTTP::Request& req, YaHTTP::Response& resp) { handler(&req, &resp); }, true);
   });
 
-  luaCtx.registerMember<std::string(YaHTTP::Request::*)>("path", [](const YaHTTP::Request& req) -> std::string { return req.url.path; }, [](YaHTTP::Request& req, const std::string& path) { (void) path; });
-  luaCtx.registerMember<int(YaHTTP::Request::*)>("version", [](const YaHTTP::Request& req) -> int { return req.version; }, [](YaHTTP::Request& req, int version) { (void) version; });
-  luaCtx.registerMember<std::string(YaHTTP::Request::*)>("method", [](const YaHTTP::Request& req) -> std::string { return req.method; }, [](YaHTTP::Request& req, const std::string& method) { (void) method; });
-  luaCtx.registerMember<std::string(YaHTTP::Request::*)>("body", [](const YaHTTP::Request& req) -> const std::string { return req.body; }, [](YaHTTP::Request& req, const std::string& body) { (void) body; });
+  luaCtx.registerMember<std::string(YaHTTP::Request::*)>("path", [](const YaHTTP::Request& req) -> std::string { return req.url.path; }, [](YaHTTP::Request& req, const std::string& path) { (void)req; (void) path; });
+  luaCtx.registerMember<int(YaHTTP::Request::*)>("version", [](const YaHTTP::Request& req) -> int { return req.version; }, [](YaHTTP::Request& req, int version) { (void)req; (void)version; });
+  luaCtx.registerMember<std::string(YaHTTP::Request::*)>("method", [](const YaHTTP::Request& req) -> std::string { return req.method; }, [](YaHTTP::Request& req, const std::string& method) { (void)req; (void) method; });
+  luaCtx.registerMember<std::string(YaHTTP::Request::*)>("body", [](const YaHTTP::Request& req) -> const std::string { return req.body; }, [](YaHTTP::Request& req, const std::string& body) { (void)req; (void)body; });
   luaCtx.registerMember<LuaAssociativeTable<std::string>(YaHTTP::Request::*)>("getvars", [](const YaHTTP::Request& req) {
     LuaAssociativeTable<std::string> values;
     for (const auto& entry : req.getvars) {
       values.insert({entry.first, entry.second});
     }
     return values;
-  }, [](YaHTTP::Request& req, const LuaAssociativeTable<std::string>& values) { (void) values; });
+  }, [](YaHTTP::Request& req, const LuaAssociativeTable<std::string>& values) { (void)req; (void)values; });
   luaCtx.registerMember<LuaAssociativeTable<std::string>(YaHTTP::Request::*)>("postvars", [](const YaHTTP::Request& req) {
     LuaAssociativeTable<std::string> values;
     for (const auto& entry : req.postvars) {
       values.insert({entry.first, entry.second});
     }
     return values;
-  }, [](YaHTTP::Request& req, const LuaAssociativeTable<std::string>& values) { (void) values; });
+  }, [](YaHTTP::Request& req, const LuaAssociativeTable<std::string>& values) { (void)req; (void)values; });
   luaCtx.registerMember<LuaAssociativeTable<std::string>(YaHTTP::Request::*)>("headers", [](const YaHTTP::Request& req) {
     LuaAssociativeTable<std::string> values;
     for (const auto& entry : req.headers) {
       values.insert({entry.first, entry.second});
     }
     return values;
-  }, [](YaHTTP::Request& req, const LuaAssociativeTable<std::string>& values) { (void) values; });
+  }, [](YaHTTP::Request& req, const LuaAssociativeTable<std::string>& values) { (void)req; (void)values; });
 
   /* Response */
   luaCtx.registerMember<std::string(YaHTTP::Response::*)>("body", [](const YaHTTP::Response& resp) -> const std::string { return resp.body; }, [](YaHTTP::Response& resp, const std::string& body) { resp.body = body; });
index 2b19ecdeb2cc516c19538ee474e6dbd41aadd5f3..c80da661fcfb52c46508dfd3aa5456e3a85e1cb6 100644 (file)
@@ -480,6 +480,8 @@ void IncomingHTTP2Connection::writeToSocket(bool socketReady)
 
 ssize_t IncomingHTTP2Connection::send_callback(nghttp2_session* session, const uint8_t* data, size_t length, int flags, void* user_data)
 {
+  (void)session;
+  (void)flags;
   auto* conn = static_cast<IncomingHTTP2Connection*>(user_data);
   if (conn->d_connectionDied) {
     return static_cast<ssize_t>(length);
@@ -550,6 +552,7 @@ void NGHTTP2Headers::addDynamicHeader(std::vector<nghttp2_nv>& headers, NGHTTP2H
 
 IOState IncomingHTTP2Connection::sendResponse(const struct timeval& now, TCPResponse&& response)
 {
+  (void)now;
   if (response.d_idstate.d_streamID == -1) {
     throw std::runtime_error("Invalid DoH stream ID while sending response");
   }
@@ -601,6 +604,7 @@ bool IncomingHTTP2Connection::sendResponse(IncomingHTTP2Connection::StreamID str
 
   data_provider.source.ptr = this;
   data_provider.read_callback = [](nghttp2_session*, IncomingHTTP2Connection::StreamID stream_id, uint8_t* buf, size_t length, uint32_t* data_flags, nghttp2_data_source* source, void* cb_data) -> ssize_t {
+    (void)source;
     auto* connection = static_cast<IncomingHTTP2Connection*>(cb_data);
     auto& obj = connection->d_currentStreams.at(stream_id);
     size_t toCopy = 0;
@@ -907,6 +911,7 @@ void IncomingHTTP2Connection::handleIncomingQuery(IncomingHTTP2Connection::Pendi
 
 int IncomingHTTP2Connection::on_frame_recv_callback(nghttp2_session* session, const nghttp2_frame* frame, void* user_data)
 {
+  (void)session;
   auto* conn = static_cast<IncomingHTTP2Connection*>(user_data);
   /* is this the last frame for this stream? */
   if ((frame->hd.type == NGHTTP2_HEADERS || frame->hd.type == NGHTTP2_DATA) && (frame->hd.flags & NGHTTP2_FLAG_END_STREAM) != 0) {
@@ -929,6 +934,8 @@ int IncomingHTTP2Connection::on_frame_recv_callback(nghttp2_session* session, co
 
 int IncomingHTTP2Connection::on_stream_close_callback(nghttp2_session* session, IncomingHTTP2Connection::StreamID stream_id, uint32_t error_code, void* user_data)
 {
+  (void)session;
+  (void)error_code;
   auto* conn = static_cast<IncomingHTTP2Connection*>(user_data);
 
   conn->d_currentStreams.erase(stream_id);
@@ -937,6 +944,7 @@ int IncomingHTTP2Connection::on_stream_close_callback(nghttp2_session* session,
 
 int IncomingHTTP2Connection::on_begin_headers_callback(nghttp2_session* session, const nghttp2_frame* frame, void* user_data)
 {
+  (void)session;
   if (frame->hd.type != NGHTTP2_HEADERS || frame->headers.cat != NGHTTP2_HCAT_REQUEST) {
     return 0;
   }
@@ -973,6 +981,8 @@ static std::string::size_type getLengthOfPathWithoutParameters(const std::string
 
 int IncomingHTTP2Connection::on_header_callback(nghttp2_session* session, const nghttp2_frame* frame, const uint8_t* name, size_t nameLen, const uint8_t* value, size_t valuelen, uint8_t flags, void* user_data)
 {
+  (void)session;
+  (void)flags;
   auto* conn = static_cast<IncomingHTTP2Connection*>(user_data);
 
   if (frame->hd.type == NGHTTP2_HEADERS && frame->headers.cat == NGHTTP2_HCAT_REQUEST) {
@@ -1054,6 +1064,8 @@ int IncomingHTTP2Connection::on_header_callback(nghttp2_session* session, const
 
 int IncomingHTTP2Connection::on_data_chunk_recv_callback(nghttp2_session* session, uint8_t flags, IncomingHTTP2Connection::StreamID stream_id, const uint8_t* data, size_t len, void* user_data)
 {
+  (void)session;
+  (void)flags;
   auto* conn = static_cast<IncomingHTTP2Connection*>(user_data);
   auto stream = conn->d_currentStreams.find(stream_id);
   if (stream == conn->d_currentStreams.end()) {
@@ -1073,9 +1085,10 @@ int IncomingHTTP2Connection::on_data_chunk_recv_callback(nghttp2_session* sessio
 
 int IncomingHTTP2Connection::on_error_callback(nghttp2_session* session, int lib_error_code, const char* msg, size_t len, void* user_data)
 {
+  (void)session;
   auto* conn = static_cast<IncomingHTTP2Connection*>(user_data);
 
-  vinfolog("Error in HTTP/2 connection from %d: %s", conn->d_ci.remote.toStringWithPort(), std::string(msg, len));
+  vinfolog("Error in HTTP/2 connection from %s: %s (%d)", conn->d_ci.remote.toStringWithPort(), std::string(msg, len), lib_error_code);
   conn->d_connectionClosing = true;
   conn->d_needFlush = true;
   nghttp2_session_terminate_session(conn->d_session.get(), NGHTTP2_NO_ERROR);
index e42ff741af75a0d8542d94377d17fba72af4d670..3ce8c376f2bd15414b0835fbcbce5aabe1177647 100644 (file)
@@ -197,6 +197,7 @@ void DoHConnectionToBackend::handleIOError()
 
 void DoHConnectionToBackend::handleTimeout(const struct timeval& now, bool write)
 {
+  (void)now;
   if (write) {
     if (d_firstWrite) {
       ++d_ds->tcpConnectTimeouts;
@@ -301,6 +302,8 @@ void DoHConnectionToBackend::queueQuery(std::shared_ptr<TCPQuerySender>& sender,
 
   data_provider.source.ptr = this;
   data_provider.read_callback = [](nghttp2_session* session, int32_t stream_id, uint8_t* buf, size_t length, uint32_t* data_flags, nghttp2_data_source* source, void* user_data) -> ssize_t {
+    (void)session;
+    (void)source;
     auto* conn = static_cast<DoHConnectionToBackend*>(user_data);
     auto& request = conn->d_currentStreams.at(stream_id);
     size_t toCopy = 0;
@@ -513,6 +516,8 @@ void DoHConnectionToBackend::watchForRemoteHostClosingConnection()
 
 ssize_t DoHConnectionToBackend::send_callback(nghttp2_session* session, const uint8_t* data, size_t length, int flags, void* user_data)
 {
+  (void)session;
+  (void)flags;
   DoHConnectionToBackend* conn = reinterpret_cast<DoHConnectionToBackend*>(user_data);
   bool bufferWasEmpty = conn->d_out.empty();
   if (!conn->d_proxyProtocolPayloadSent && !conn->d_proxyProtocolPayload.empty()) {
@@ -555,6 +560,7 @@ ssize_t DoHConnectionToBackend::send_callback(nghttp2_session* session, const ui
 
 int DoHConnectionToBackend::on_frame_recv_callback(nghttp2_session* session, const nghttp2_frame* frame, void* user_data)
 {
+  (void)session;
   DoHConnectionToBackend* conn = reinterpret_cast<DoHConnectionToBackend*>(user_data);
   // cerr<<"Frame type is "<<std::to_string(frame->hd.type)<<endl;
 #if 0
@@ -628,6 +634,8 @@ int DoHConnectionToBackend::on_frame_recv_callback(nghttp2_session* session, con
 
 int DoHConnectionToBackend::on_data_chunk_recv_callback(nghttp2_session* session, uint8_t flags, int32_t stream_id, const uint8_t* data, size_t len, void* user_data)
 {
+  (void)session;
+  (void)flags;
   DoHConnectionToBackend* conn = reinterpret_cast<DoHConnectionToBackend*>(user_data);
   // cerr<<"Got data of size "<<len<<" for stream "<<stream_id<<endl;
   auto stream = conn->d_currentStreams.find(stream_id);
@@ -676,6 +684,7 @@ int DoHConnectionToBackend::on_data_chunk_recv_callback(nghttp2_session* session
 
 int DoHConnectionToBackend::on_stream_close_callback(nghttp2_session* session, int32_t stream_id, uint32_t error_code, void* user_data)
 {
+  (void)session;
   DoHConnectionToBackend* conn = reinterpret_cast<DoHConnectionToBackend*>(user_data);
 
   if (error_code == 0) {
@@ -724,6 +733,8 @@ int DoHConnectionToBackend::on_stream_close_callback(nghttp2_session* session, i
 
 int DoHConnectionToBackend::on_header_callback(nghttp2_session* session, const nghttp2_frame* frame, const uint8_t* name, size_t namelen, const uint8_t* value, size_t valuelen, uint8_t flags, void* user_data)
 {
+  (void)session;
+  (void)flags;
   DoHConnectionToBackend* conn = reinterpret_cast<DoHConnectionToBackend*>(user_data);
 
   const std::string status(":status");
@@ -754,7 +765,8 @@ int DoHConnectionToBackend::on_header_callback(nghttp2_session* session, const n
 
 int DoHConnectionToBackend::on_error_callback(nghttp2_session* session, int lib_error_code, const char* msg, size_t len, void* user_data)
 {
-  vinfolog("Error in HTTP/2 connection: %s", std::string(msg, len));
+  (void)session;
+  vinfolog("Error in HTTP/2 connection: %s (%d)", std::string(msg, len), lib_error_code);
 
   DoHConnectionToBackend* conn = reinterpret_cast<DoHConnectionToBackend*>(user_data);
   conn->d_connectionDied = true;
@@ -821,6 +833,7 @@ DoHConnectionToBackend::DoHConnectionToBackend(const std::shared_ptr<DownstreamS
 
 static void handleCrossProtocolQuery(int pipefd, FDMultiplexer::funcparam_t& param)
 {
+  (void)pipefd;
   auto threadData = boost::any_cast<DoHClientThreadData*>(param);
 
   std::unique_ptr<CrossProtocolQuery> cpq{nullptr};
index cbd8c619d999659a4dfd6edf03f6199fe4070f0c..c32399fbad384dd56e107313d88a6f1afe39e849 100644 (file)
@@ -80,6 +80,7 @@ static int handleCounter64Stats(netsnmp_mib_handler* handler,
                                 netsnmp_agent_request_info* reqinfo,
                                 netsnmp_request_info* requests)
 {
+  (void)handler;
   if (reqinfo->mode != MODE_GET) {
     return SNMP_ERR_GENERR;
   }
@@ -126,6 +127,7 @@ static int handleFloatStats(netsnmp_mib_handler* handler,
                             netsnmp_agent_request_info* reqinfo,
                             netsnmp_request_info* requests)
 {
+  (void)handler;
   if (reqinfo->mode != MODE_GET) {
     return SNMP_ERR_GENERR;
   }
@@ -177,6 +179,7 @@ static int handleGauge64Stats(netsnmp_mib_handler* handler,
                               netsnmp_agent_request_info* reqinfo,
                               netsnmp_request_info* requests)
 {
+  (void)handler;
   if (reqinfo->mode != MODE_GET) {
     return SNMP_ERR_GENERR;
   }
@@ -259,6 +262,8 @@ static netsnmp_variable_list* backendStatTable_get_next_data_point(void** loop_c
                                                                    netsnmp_variable_list* put_index_data,
                                                                    netsnmp_iterator_info* mydata)
 {
+  (void)loop_context;
+  (void)mydata;
   if (s_currentServerIdx >= s_servers.size()) {
     return nullptr;
   }
@@ -297,6 +302,8 @@ static int backendStatTable_handler(netsnmp_mib_handler* handler,
                                     netsnmp_agent_request_info* reqinfo,
                                     netsnmp_request_info* requests)
 {
+  (void)handler;
+  (void)reginfo;
   netsnmp_request_info* request{nullptr};
 
   switch (reqinfo->mode) {
index 5c269695f689b581e938b480525942b8a9d780b6..d23350b4d1174b3d850f8f94d3e0027cf81a39a4 100644 (file)
@@ -224,17 +224,12 @@ static void editPayloadID(PacketBuffer& payload, uint16_t newId, size_t proxyPro
   memcpy(&payload.at(startOfHeaderOffset), &id, sizeof(id));
 }
 
-enum class QueryState : uint8_t {
-  hasSizePrepended,
-  noSize
-};
-
 enum class ConnectionState : uint8_t {
   needProxy,
   proxySent
 };
 
-static void prepareQueryForSending(TCPQuery& query, uint16_t id, QueryState queryState, ConnectionState connectionState)
+static void prepareQueryForSending(TCPQuery& query, uint16_t id, ConnectionState connectionState)
 {
   if (connectionState == ConnectionState::needProxy) {
     if (query.d_proxyProtocolPayload.size() > 0 && !query.d_proxyProtocolPayloadAdded) {
@@ -266,7 +261,7 @@ IOState TCPConnectionToBackend::queueNextQuery(std::shared_ptr<TCPConnectionToBa
   conn->d_currentQuery = std::move(conn->d_pendingQueries.front());
 
   uint16_t id = conn->d_highestStreamID;
-  prepareQueryForSending(conn->d_currentQuery.d_query, id, QueryState::hasSizePrepended, conn->needProxyProtocolPayload() ? ConnectionState::needProxy : ConnectionState::proxySent);
+  prepareQueryForSending(conn->d_currentQuery.d_query, id, conn->needProxyProtocolPayload() ? ConnectionState::needProxy : ConnectionState::proxySent);
 
   conn->d_pendingQueries.pop_front();
   conn->d_state = State::sendingQueryToBackend;
@@ -277,6 +272,7 @@ IOState TCPConnectionToBackend::queueNextQuery(std::shared_ptr<TCPConnectionToBa
 
 IOState TCPConnectionToBackend::sendQuery(std::shared_ptr<TCPConnectionToBackend>& conn, const struct timeval& now)
 {
+  (void)now;
   DEBUGLOG("sending query to backend "<<conn->getDS()->getNameWithAddr()<<" over FD "<<conn->d_handler->getDescriptor());
 
   IOState state = conn->d_handler->tryWrite(conn->d_currentQuery.d_query.d_buffer, conn->d_currentPos, conn->d_currentQuery.d_query.d_buffer.size());
@@ -428,7 +424,7 @@ void TCPConnectionToBackend::handleIO(std::shared_ptr<TCPConnectionToBackend>& c
               /* we need to edit this query so it has the correct ID */
               auto query = std::move(conn->d_currentQuery);
               uint16_t id = conn->d_highestStreamID;
-              prepareQueryForSending(query.d_query, id, QueryState::hasSizePrepended, ConnectionState::needProxy);
+              prepareQueryForSending(query.d_query, id, ConnectionState::needProxy);
               conn->d_currentQuery = std::move(query);
             }
 
@@ -542,7 +538,7 @@ void TCPConnectionToBackend::queueQuery(std::shared_ptr<TCPQuerySender>& sender,
     uint16_t id = d_highestStreamID;
 
     d_currentQuery = PendingRequest({sender, std::move(query)});
-    prepareQueryForSending(d_currentQuery.d_query, id, QueryState::hasSizePrepended, needProxyProtocolPayload() ? ConnectionState::needProxy : ConnectionState::proxySent);
+    prepareQueryForSending(d_currentQuery.d_query, id, needProxyProtocolPayload() ? ConnectionState::needProxy : ConnectionState::proxySent);
 
     struct timeval now;
     gettimeofday(&now, 0);
index df177c877825b7fb44507e86514209d94393abed..e7c3a1a3b9246120f6e7688b7debd2a577daf7ad 100644 (file)
@@ -165,6 +165,7 @@ public:
   }
   virtual std::unique_ptr<DOHUnitInterface> getDOHUnit(uint32_t streamID)
   {
+    (void)streamID;
     throw std::runtime_error("Getting a DOHUnit state from a generic TCP/DoT connection is not supported");
   }
   virtual void restoreDOHUnit(std::unique_ptr<DOHUnitInterface>&&)
index d2516352146c551bb1e9039f38cf526572f2050f..5454a156a8eccaa06d1e27dbf643958c89cc55af 100644 (file)
@@ -288,6 +288,7 @@ void IncomingTCPConnectionState::registerOwnedDownstreamConnection(std::shared_p
 /* called when the buffer has been set and the rules have been processed, and only from handleIO (sometimes indirectly via handleQuery) */
 IOState IncomingTCPConnectionState::sendResponse(const struct timeval& now, TCPResponse&& response)
 {
+  (void)now;
   d_state = State::sendingResponse;
 
   const auto responseSize = static_cast<uint16_t>(response.d_buffer.size());
@@ -1208,7 +1209,7 @@ void IncomingTCPConnectionState::notifyIOError(const struct timeval& now, TCPRes
   }
 }
 
-static bool processXFRResponse(PacketBuffer& response, DNSResponse& dnsResponse)
+static bool processXFRResponse(DNSResponse& dnsResponse)
 {
   const auto& chains = dnsdist::configuration::getCurrentRuntimeConfiguration().d_ruleChains;
   const auto& xfrRespRuleActions = dnsdist::rules::getResponseRuleChain(chains, dnsdist::rules::ResponseRuleChain::XFRResponseRules);
@@ -1242,7 +1243,7 @@ void IncomingTCPConnectionState::handleXFRResponse(const struct timeval& now, TC
   dnsResponse.d_incomingTCPState = state;
   memcpy(&response.d_cleartextDH, dnsResponse.getHeader().get(), sizeof(response.d_cleartextDH));
 
-  if (!processXFRResponse(response.d_buffer, dnsResponse)) {
+  if (!processXFRResponse(dnsResponse)) {
     state->terminateClientConnection();
     return;
   }
@@ -1270,6 +1271,7 @@ void IncomingTCPConnectionState::handleTimeout(std::shared_ptr<IncomingTCPConnec
 
 static void handleIncomingTCPQuery(int pipefd, FDMultiplexer::funcparam_t& param)
 {
+  (void)pipefd;
   auto* threadData = boost::any_cast<TCPClientThreadData*>(param);
 
   std::unique_ptr<ConnectionInfo> citmp{nullptr};
@@ -1303,6 +1305,7 @@ static void handleIncomingTCPQuery(int pipefd, FDMultiplexer::funcparam_t& param
 
 static void handleCrossProtocolQuery(int pipefd, FDMultiplexer::funcparam_t& param)
 {
+  (void)pipefd;
   auto* threadData = boost::any_cast<TCPClientThreadData*>(param);
 
   std::unique_ptr<CrossProtocolQuery> cpq{nullptr};
@@ -1340,6 +1343,7 @@ static void handleCrossProtocolQuery(int pipefd, FDMultiplexer::funcparam_t& par
 
 static void handleCrossProtocolResponse(int pipefd, FDMultiplexer::funcparam_t& param)
 {
+  (void)pipefd;
   auto* threadData = boost::any_cast<TCPClientThreadData*>(param);
 
   std::unique_ptr<TCPCrossProtocolResponse> cpr{nullptr};
@@ -1509,6 +1513,7 @@ static void tcpClientThread(pdns::channel::Receiver<ConnectionInfo>&& queryRecei
     }
 
     auto acceptCallback = [&data](int socket, FDMultiplexer::funcparam_t& funcparam) {
+      (void)socket;
       const auto* acceptorParam = boost::any_cast<const TCPAcceptorParam*>(funcparam);
       acceptNewConnection(*acceptorParam, &data);
     };
@@ -1671,6 +1676,7 @@ void tcpAcceptorThread(const std::vector<ClientState*>& states)
   }
   else {
     auto acceptCallback = [](int socket, FDMultiplexer::funcparam_t& funcparam) {
+      (void)socket;
       const auto* acceptorParam = boost::any_cast<const TCPAcceptorParam*>(funcparam);
       acceptNewConnection(*acceptorParam, nullptr);
     };
index 94db95c31ae1850f0f1048da3cb4e553fe0842d1..fc529283eaeacb1e045a72e0880d755cddfff3a7 100644 (file)
@@ -1737,7 +1737,7 @@ void clearWebHandlers()
 #ifndef DISABLE_BUILTIN_HTML
 #include "htmlfiles.h"
 
-static void redirectToIndex(const YaHTTP::Request& req, YaHTTP::Response& resp)
+static void redirectToIndex([[maybe_unused]] const YaHTTP::Request& req, YaHTTP::Response& resp)
 {
   const string charset = "; charset=utf-8";
   resp.body.assign(s_urlmap.at("index.html"));
index e54005a9912221d17f046db43a9b0d849bd49559..22ae585217f15e720e8bcd75db6a07b287a721c3 100644 (file)
@@ -1310,7 +1310,7 @@ bool checkQueryHeaders(const struct dnsheader& dnsHeader, ClientState& clientSta
 }
 
 #if !defined(DISABLE_RECVMMSG) && defined(HAVE_RECVMMSG) && defined(HAVE_SENDMMSG) && defined(MSG_WAITFORONE)
-static void queueResponse(const ClientState& clientState, const PacketBuffer& response, const ComboAddress& dest, const ComboAddress& remote, struct mmsghdr& outMsg, struct iovec* iov, cmsgbuf_aligned* cbuf)
+static void queueResponse(const PacketBuffer& response, const ComboAddress& dest, const ComboAddress& remote, struct mmsghdr& outMsg, struct iovec* iov, cmsgbuf_aligned* cbuf)
 {
   outMsg.msg_len = 0;
   // NOLINTNEXTLINE(cppcoreguidelines-pro-type-const-cast,cppcoreguidelines-pro-type-reinterpret-cast): API
@@ -1579,6 +1579,7 @@ public:
 
   void handleResponse(const struct timeval& now, TCPResponse&& response) override
   {
+    (void)now;
     if (!response.d_ds && !response.d_idstate.selfGenerated) {
       throw std::runtime_error("Passing a cross-protocol answer originated from UDP without a valid downstream");
     }
@@ -1833,7 +1834,7 @@ static void processUDPQuery(ClientState& clientState, const struct msghdr* msgh,
 #ifndef DISABLE_RECVMMSG
 #if defined(HAVE_RECVMMSG) && defined(HAVE_SENDMMSG) && defined(MSG_WAITFORONE)
       if (dnsQuestion.ids.delayMsec == 0 && responsesVect != nullptr) {
-        queueResponse(clientState, query, dest, remote, (*responsesVect)[*queuedResponses], respIOV, respCBuf);
+        queueResponse(query, dest, remote, (*responsesVect)[*queuedResponses], respIOV, respCBuf);
         (*queuedResponses)++;
         handleResponseSent(dnsQuestion.ids.qname, dnsQuestion.ids.qtype, 0., remote, ComboAddress(), query.size(), *dnsHeader, dnsdist::Protocol::DoUDP, dnsdist::Protocol::DoUDP, false);
         return;
@@ -2173,6 +2174,7 @@ static void udpClientThread(std::vector<ClientState*> states)
       }
       else {
         auto callback = [&remote, &msgh, &iov, &packet, &handleOnePacket, initialBufferSize](int socket, FDMultiplexer::funcparam_t& funcparam) {
+          (void)socket;
           const auto* param = boost::any_cast<const UDPStateParam*>(funcparam);
           try {
             remote.sin4.sin_family = param->cs->local.sin4.sin_family;
@@ -2369,7 +2371,7 @@ static void healthChecksThread()
   }
 }
 
-static void bindAny(int addressFamily, int sock)
+static void bindAny([[maybe_unused]] int addressFamily, int sock)
 {
   __attribute__((unused)) int one = 1;
 
index 739684477b8277de8ac606ef936b8fa92000d899..f59298e2f3cbea73364d594ed1147c8737e2f522 100644 (file)
@@ -485,6 +485,7 @@ public:
 
   void handleResponse(const struct timeval& now, TCPResponse&& response) override
   {
+    (void)now;
     if (!response.d_idstate.du) {
       return;
     }
@@ -546,6 +547,7 @@ public:
 
   void notifyIOError(const struct timeval& now, TCPResponse&& response) override
   {
+    (void)now;
     auto& query = response.d_idstate;
     if (!query.du) {
       return;
@@ -856,6 +858,7 @@ static void processDOHQuery(DOHUnitUniquePtr&& unit, bool inMainThread = false)
 /* called when a HTTP response is about to be sent, from the main DoH thread */
 static void on_response_ready_cb(struct st_h2o_filter_t *self, h2o_req_t *req, h2o_ostream_t **slot)
 {
+  (void)self;
   if (req == nullptr) {
     return;
   }
@@ -1294,6 +1297,7 @@ static void dnsdistclient(pdns::channel::Receiver<DOHUnit>&& receiver)
    */
 static void on_dnsdist(h2o_socket_t *listener, const char *err)
 {
+  (void)err;
   /* we want to read as many responses from the pipe as possible before
      giving up. Even if we are overloaded and fighting with the DoH connections
      for the CPU, the first thing we need to do is to send responses to free slots
index edd08934d1d1467103886d3dd6073e4317656917..c67f053db9b3a19d95d0100a71f8ef7ce2bba8e1 100644 (file)
@@ -780,7 +780,7 @@ static void processH3HeaderEvent(ClientState& clientState, DOH3Frontend& fronten
   handleImmediateError("Unsupported HTTP method");
 }
 
-static void processH3DataEvent(ClientState& clientState, DOH3Frontend& frontend, H3Connection& conn, const ComboAddress& client, const PacketBuffer& serverConnID, const uint64_t streamID, quiche_h3_event* event, PacketBuffer& buffer)
+static void processH3DataEvent(ClientState& clientState, DOH3Frontend& frontend, H3Connection& conn, const ComboAddress& client, const PacketBuffer& serverConnID, const uint64_t streamID, PacketBuffer& buffer)
 {
   auto handleImmediateError = [&clientState, &frontend, &conn, streamID](const char* msg) {
     DEBUGLOG(msg);
@@ -854,7 +854,7 @@ static void processH3Events(ClientState& clientState, DOH3Frontend& frontend, H3
       break;
     }
     case QUICHE_H3_EVENT_DATA: {
-      processH3DataEvent(clientState, frontend, conn, client, serverConnID, streamID, event, buffer);
+      processH3DataEvent(clientState, frontend, conn, client, serverConnID, streamID, buffer);
       break;
     }
     case QUICHE_H3_EVENT_FINISHED:
index fa113aa83a0f0e8e73242695f0741ad518169541..00e879af2d44560110f89e1ba49bc6d86b61b7a5 100644 (file)
@@ -71,8 +71,9 @@ public:
   {
   }
 
-  void release(bool removeFomCache)
+  void release(bool removeFromCache)
   {
+    (void)removeFromCache;
   }
 
   std::shared_ptr<DownstreamState> getDS() const
index 014764974a3b22b34ed7ba7de40e00f32a588c26..f1145625f6e1cd0a7b3ad6d54748df23e11bbb68 100644 (file)
@@ -37,6 +37,7 @@
 
 bool dnsdist::webserver::addMetricDefinition(const dnsdist::prometheus::PrometheusMetricDefinition& def)
 {
+  (void)def;
   return true;
 }
 
index 38dbd916d3978539f936485d8c1f366e1be2e4eb..63288e26d8d3081c95d5a19472f87883bd358b7b 100644 (file)
 
 ProcessQueryResult processQueryAfterRules(DNSQuestion& dnsQuestion, std::shared_ptr<DownstreamState>& selectedBackend)
 {
+  (void)dnsQuestion;
+  (void)selectedBackend;
   return ProcessQueryResult::Drop;
 }
 
 bool processResponseAfterRules(PacketBuffer& response, DNSResponse& dnsResponse, bool muted)
 {
+  (void)response;
+  (void)dnsResponse;
+  (void)muted;
   return false;
 }
 
 bool applyRulesToResponse(const std::vector<dnsdist::rules::ResponseRuleAction>& respRuleActions, DNSResponse& dnsResponse)
 {
+  (void)respRuleActions;
+  (void)dnsResponse;
   return true;
 }
 
 bool sendUDPResponse(int origFD, const PacketBuffer& response, const int delayMsec, const ComboAddress& origDest, const ComboAddress& origRemote)
 {
+  (void)origFD;
+  (void)response;
+  (void)delayMsec;
+  (void)origDest;
+  (void)origRemote;
   return false;
 }
 
 bool assignOutgoingUDPQueryToBackend(std::shared_ptr<DownstreamState>& downstream, uint16_t queryID, DNSQuestion& dnsQuestion, PacketBuffer& query, bool actuallySend)
 {
+  (void)downstream;
+  (void)queryID;
+  (void)dnsQuestion;
+  (void)query;
+  (void)actuallySend;
   return true;
 }
 
@@ -72,6 +89,8 @@ namespace dnsdist
 {
 std::unique_ptr<CrossProtocolQuery> getInternalQueryFromDQ(DNSQuestion& dnsQuestion, bool isResponse)
 {
+  (void)dnsQuestion;
+  (void)isResponse;
   return nullptr;
 }
 }
@@ -87,6 +106,8 @@ namespace dnsdist::xsk
 {
 bool XskProcessQuery(ClientState& clientState, XskPacket& packet)
 {
+  (void)clientState;
+  (void)packet;
   return false;
 }
 }
@@ -94,6 +115,9 @@ bool XskProcessQuery(ClientState& clientState, XskPacket& packet)
 
 bool processResponderPacket(std::shared_ptr<DownstreamState>& dss, PacketBuffer& response, InternalQueryState&& ids)
 {
+  (void)dss;
+  (void)response;
+  (void)ids;
   return false;
 }
 
index 388389f66fba9c649e070e3fe9ef08ee1a6a7735..4038655e10acbce8eb17fdee8546bda7a42b9164 100644 (file)
@@ -1295,6 +1295,8 @@ BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesMetricsCache_GetTopN, TestFixture) {
     {
       DynBlockRulesGroup::DynBlockRule rule(reason, blockDuration, 0, 0, numberOfSeconds, action);
       dbrg.setSuffixMatchRule(std::move(rule), [](const StatNode& node, const StatNode::Stat& self, const StatNode::Stat& children) {
+        (void)node;
+        (void)children;
         if (self.queries > 0) {
           return std::tuple<bool, boost::optional<std::string>, boost::optional<int>>(true, boost::none, boost::none);
         }
@@ -1355,6 +1357,8 @@ BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesMetricsCache_GetTopN, TestFixture) {
     {
       DynBlockRulesGroup::DynBlockRule rule(reason, blockDuration, 0, 0, numberOfSeconds, action);
       dbrg.setSuffixMatchRule(std::move(rule), [](const StatNode& node, const StatNode::Stat& self, const StatNode::Stat& children) {
+        (void)node;
+        (void)children;
         if (self.queries > 0) {
           return std::tuple<bool, boost::optional<std::string>, boost::optional<int>>(true, "blocked for a different reason", static_cast<int>(DNSAction::Action::Truncate));
         }
index 9cdaa0b2a6c4ceaf0e9bd9d67ea5d9fcb1bfcab6..3d3a712b5ddc16d3a1b5e7d12e4f80a1bffc5ab7 100644 (file)
@@ -35,6 +35,8 @@ bool TLSFrontend::setupTLS()
 // NOLINTNEXTLINE(readability-convert-member-functions-to-static): this is a stub, the real one is not that simple..
 bool DNSDistSNMPAgent::sendDNSTrap(const DNSQuestion& dnsQuestion, const std::string& reason)
 {
+  (void)dnsQuestion;
+  (void)reason;
   return false;
 }
 
@@ -51,6 +53,7 @@ bool setupDoTProtocolNegotiation(std::shared_ptr<TLSCtx>& tlsCtx)
 // NOLINTNEXTLINE(performance-unnecessary-value-param): this is a stub, the real one is not that simple and the performance does not matter
 void responderThread(std::shared_ptr<DownstreamState> dss)
 {
+  (void)dss;
 }
 
 string g_outputBuffer;
@@ -99,6 +102,8 @@ static void benchPolicy(const ServerPolicy& pol)
     }
   }
   cerr << pol.name << " took " << std::to_string(sw.udiff()) << " us for " << names.size() << endl;
+#else
+  (void)pol;
 #endif /* BENCH_POLICIES */
 }
 
index 6ddc4a2005876c9e272e8531b9bf9f553dc2ae01..e84b524dfe6e9a91ddbc5ac83f7fa8e98c72e584 100644 (file)
@@ -42,6 +42,7 @@ BOOST_AUTO_TEST_CASE(test_Basic)
   BOOST_REQUIRE(fd >= 0);
 
   listener.addUnixListeningEndpoint(socketPath, 0, [&received, payload](dnsdist::NetworkListener::EndpointID endpoint, std::string&& dgram, const std::string& from) {
+    (void)from;
     BOOST_CHECK_EQUAL(endpoint, 0U);
     BOOST_CHECK(dgram == payload);
     received = true;
@@ -76,7 +77,11 @@ BOOST_AUTO_TEST_CASE(test_Exceptions)
     /* invalid path */
     dnsdist::NetworkListener listener;
     BOOST_CHECK_THROW(listener.addUnixListeningEndpoint(std::string(), 0,
-                                                        [](dnsdist::NetworkListener::EndpointID endpoint, std::string&& dgram, const std::string& from) {}),
+                                                        [](dnsdist::NetworkListener::EndpointID endpoint, std::string&& dgram, const std::string& from) {
+                                                          (void)endpoint;
+                                                          (void)dgram;
+                                                          (void)from;
+                                                        }),
                       std::runtime_error);
 
     bool caught = false;
@@ -94,6 +99,9 @@ BOOST_AUTO_TEST_CASE(test_Exceptions)
     dnsdist::NetworkListener listener;
     bool received = false;
     listener.addUnixListeningEndpoint(socketPath, 0, [&received](dnsdist::NetworkListener::EndpointID endpoint, std::string&& dgram, const std::string& from) {
+      (void)endpoint;
+      (void)dgram;
+      (void)from;
       received = true;
     });
 
@@ -109,7 +117,11 @@ BOOST_AUTO_TEST_CASE(test_Exceptions)
     bool raised = false;
     try {
       listener.addUnixListeningEndpoint(otherSocketPath, 0,
-                                        [](dnsdist::NetworkListener::EndpointID endpoint, std::string&& dgram, const std::string& from) {});
+                                        [](dnsdist::NetworkListener::EndpointID endpoint, std::string&& dgram, const std::string& from) {
+                                          (void)endpoint;
+                                          (void)dgram;
+                                          (void)from;
+                                        });
     }
     catch (const std::runtime_error& e) {
       raised = true;
@@ -122,6 +134,9 @@ BOOST_AUTO_TEST_CASE(test_Exceptions)
     dnsdist::NetworkListener listener;
     bool received = false;
     listener.addUnixListeningEndpoint(socketPath, 0, [&received](dnsdist::NetworkListener::EndpointID endpoint, std::string&& dgram, const std::string& from) {
+      (void)endpoint;
+      (void)dgram;
+      (void)from;
       received = true;
       throw std::runtime_error("Test exception");
     });
@@ -142,6 +157,9 @@ BOOST_AUTO_TEST_CASE(test_Exceptions)
     dnsdist::NetworkListener listener;
     bool received = false;
     listener.addUnixListeningEndpoint(socketPath, 0, [&received](dnsdist::NetworkListener::EndpointID endpoint, std::string&& dgram, const std::string& from) {
+      (void)endpoint;
+      (void)dgram;
+      (void)from;
       received = true;
       throw UnexpectedException();
     });
@@ -169,6 +187,7 @@ BOOST_AUTO_TEST_CASE(test_Abstract)
   socketPath.insert(0, 1, 0);
 
   listener.addUnixListeningEndpoint(socketPath, 0, [&received, payload](dnsdist::NetworkListener::EndpointID endpoint, std::string&& dgram, const std::string& from) {
+    (void)from;
     BOOST_CHECK_EQUAL(endpoint, 0U);
     BOOST_CHECK(dgram == payload);
     received = true;
@@ -189,13 +208,20 @@ BOOST_AUTO_TEST_CASE(test_Abstract_Exceptions)
   socketPath.insert(0, 1, 0);
   bool received = false;
   listener.addUnixListeningEndpoint(socketPath, 0, [&received](dnsdist::NetworkListener::EndpointID endpoint, std::string&& dgram, const std::string& from) {
+    (void)endpoint;
+    (void)dgram;
+    (void)from;
     received = true;
   });
 
   /* try binding twice to the same path */
   bool raised = false;
   try {
-    listener.addUnixListeningEndpoint(socketPath, 0, [](dnsdist::NetworkListener::EndpointID endpoint, std::string&& dgram, const std::string& from) {});
+    listener.addUnixListeningEndpoint(socketPath, 0, [](dnsdist::NetworkListener::EndpointID endpoint, std::string&& dgram, const std::string& from) {
+      (void)endpoint;
+      (void)dgram;
+      (void)from;
+    });
   }
   catch (const std::runtime_error& e) {
     raised = true;
index a24341f13ab6b8eab7a7a22e2096d22b0f81c7d6..d67288fe5737a5e27cbb93305472903b6e98d882 100644 (file)
@@ -143,6 +143,9 @@ public:
       nghttp2_data_provider data_provider;
       data_provider.source.ptr = this;
       data_provider.read_callback = [](nghttp2_session* session, int32_t stream_id, uint8_t* buf, size_t length, uint32_t* data_flags, nghttp2_data_source* source, void* user_data) -> ssize_t {
+        (void)session;
+        (void)stream_id;
+        (void)source;
         auto* conn = static_cast<DOHConnection*>(user_data);
         auto& pos = conn->d_position;
         const auto& currentQuery = conn->d_currentQuery;
@@ -197,6 +200,8 @@ public:
 private:
   static ssize_t send_callback(nghttp2_session* session, const uint8_t* data, size_t length, int flags, void* user_data)
   {
+    (void)session;
+    (void)flags;
     auto* conn = static_cast<DOHConnection*>(user_data);
     // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic): nghttp2 API
     conn->d_clientOutBuffer.insert(conn->d_clientOutBuffer.end(), data, data + length);
@@ -205,6 +210,7 @@ private:
 
   static int on_frame_recv_callback(nghttp2_session* session, const nghttp2_frame* frame, void* user_data)
   {
+    (void)session;
     auto* conn = static_cast<DOHConnection*>(user_data);
     if ((frame->hd.type == NGHTTP2_HEADERS || frame->hd.type == NGHTTP2_DATA) && (frame->hd.flags & NGHTTP2_FLAG_END_STREAM) != 0) {
       const auto& response = conn->d_responses.at(frame->hd.stream_id);
@@ -231,6 +237,8 @@ private:
 
   static int on_data_chunk_recv_callback(nghttp2_session* session, uint8_t flags, int32_t stream_id, const uint8_t* data, size_t len, void* user_data)
   {
+    (void)session;
+    (void)flags;
     auto* conn = static_cast<DOHConnection*>(user_data);
     auto& response = conn->d_responses[stream_id];
     // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic): nghttp2 API
@@ -240,6 +248,8 @@ private:
 
   static int on_header_callback(nghttp2_session* session, const nghttp2_frame* frame, const uint8_t* name, size_t namelen, const uint8_t* value, size_t valuelen, uint8_t flags, void* user_data)
   {
+    (void)session;
+    (void)flags;
     auto* conn = static_cast<DOHConnection*>(user_data);
     const std::string status(":status");
     if (frame->hd.type == NGHTTP2_HEADERS && frame->headers.cat == NGHTTP2_HCAT_RESPONSE) {
@@ -266,6 +276,10 @@ private:
 
   static int on_stream_close_callback(nghttp2_session* session, int32_t stream_id, uint32_t error_code, void* user_data)
   {
+    (void)session;
+    (void)stream_id;
+    (void)error_code;
+    (void)user_data;
     return 0;
   }
 };
@@ -361,6 +375,8 @@ public:
 
   IOState tryConnect(bool fastOpen, const ComboAddress& remote) override
   {
+    (void)fastOpen;
+    (void)remote;
     throw std::runtime_error("Should not happen");
   }
 
@@ -402,6 +418,7 @@ public:
 
   void setSession(std::unique_ptr<TLSSession>& session) override
   {
+    (void)session;
   }
 
   [[nodiscard]] std::vector<int> getAsyncFDs() override
@@ -416,15 +433,26 @@ public:
 
   void connect(bool fastOpen, const ComboAddress& remote, const struct timeval& timeout) override
   {
+    (void)fastOpen;
+    (void)remote;
+    (void)timeout;
   }
 
   size_t read(void* buffer, size_t bufferSize, const struct timeval& readTimeout, const struct timeval& totalTimeout = {0, 0}, bool allowIncomplete = false) override
   {
+    (void)buffer;
+    (void)bufferSize;
+    (void)readTimeout;
+    (void)totalTimeout;
+    (void)allowIncomplete;
     return 0;
   }
 
   size_t write(const void* buffer, size_t bufferSize, const struct timeval& writeTimeout) override
   {
+    (void)buffer;
+    (void)bufferSize;
+    (void)writeTimeout;
     return 0;
   }
 
@@ -560,6 +588,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_SelfAnswered, TestFixture)
   {
     /* dnsdist sends a response right away, client closes the connection after getting the response */
     s_processQuery = [response](DNSQuestion& dnsQuestion, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)selectedBackend;
       /* self answered */
       dnsQuestion.getMutableData() = response;
       return ProcessQueryResult::SendAnswer;
@@ -591,6 +620,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_SelfAnswered, TestFixture)
   {
     /* dnsdist sends a response right away, but the client closes the connection without even reading the response */
     s_processQuery = [response](DNSQuestion& dnsQuestion, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)selectedBackend;
       /* self answered */
       dnsQuestion.getMutableData() = response;
       return ProcessQueryResult::SendAnswer;
@@ -626,6 +656,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_SelfAnswered, TestFixture)
   {
     /* dnsdist sends a response right away, client closes the connection while getting the response */
     s_processQuery = [response](DNSQuestion& dnsQuestion, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)selectedBackend;
       /* self answered */
       dnsQuestion.getMutableData() = response;
       return ProcessQueryResult::SendAnswer;
@@ -675,9 +706,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_BackendTimeout, TestFixture)
 
   auto backend = std::make_shared<DownstreamState>(getBackendAddress("42", 53));
 
-  struct timeval now
-  {
-  };
+  timeval now{};
   gettimeofday(&now, nullptr);
 
   size_t counter = 0;
@@ -700,6 +729,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_BackendTimeout, TestFixture)
   {
     /* dnsdist forwards the query to the backend, which does not answer -> timeout */
     s_processQuery = [backend](DNSQuestion& dnsQuestion, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dnsQuestion;
       selectedBackend = backend;
       return ProcessQueryResult::PassToBackend;
     };
index 98c37243e3343b2208ef2b8d7356614c3a12e683..60e0fca09981adb0029080718750d55f880e4cae 100644 (file)
@@ -168,6 +168,9 @@ public:
     nghttp2_data_provider dataProvider;
     dataProvider.source.ptr = &data;
     dataProvider.read_callback = [](nghttp2_session* session, int32_t stream_id, uint8_t* buf, size_t length, uint32_t* data_flags, nghttp2_data_source* source, void* user_data) -> ssize_t {
+      (void)session;
+      (void)stream_id;
+      (void)user_data;
       auto buffer = reinterpret_cast<PacketBuffer*>(source->ptr);
       size_t toCopy = 0;
       if (buffer->size() > 0) {
@@ -193,6 +196,7 @@ public:
 
   void submitError(uint32_t streamId, uint16_t status, const std::string& msg)
   {
+    (void)msg;
     const std::string statusStr = std::to_string(status);
     const nghttp2_nv hdrs[] = {{(uint8_t*)":status", (uint8_t*)statusStr.c_str(), sizeof(":status") - 1, statusStr.size(), NGHTTP2_NV_FLAG_NONE}};
 
@@ -215,6 +219,8 @@ public:
 private:
   static ssize_t send_callback(nghttp2_session* session, const uint8_t* data, size_t length, int flags, void* user_data)
   {
+    (void)session;
+    (void)flags;
     DOHConnection* conn = reinterpret_cast<DOHConnection*>(user_data);
     // cerr<<"inserting "<<length<<" bytes into the server output buffer of size "<<conn->d_serverOutBuffer.size()<<endl;
     if (!conn->d_idMapping.empty() && length > 9) {
@@ -240,6 +246,7 @@ private:
 
   static int on_frame_recv_callback(nghttp2_session* session, const nghttp2_frame* frame, void* user_data)
   {
+    (void)session;
     DOHConnection* conn = reinterpret_cast<DOHConnection*>(user_data);
     // cerr<<"Frame type is "<<std::to_string(frame->hd.type)<<endl;
     if ((frame->hd.type == NGHTTP2_HEADERS || frame->hd.type == NGHTTP2_DATA) && frame->hd.flags & NGHTTP2_FLAG_END_STREAM) {
@@ -295,6 +302,8 @@ private:
 
   static int on_data_chunk_recv_callback(nghttp2_session* session, uint8_t flags, int32_t stream_id, const uint8_t* data, size_t len, void* user_data)
   {
+    (void)session;
+    (void)flags;
     DOHConnection* conn = reinterpret_cast<DOHConnection*>(user_data);
     auto& query = conn->d_queries[stream_id];
     query.insert(query.end(), data, data + len);
@@ -303,6 +312,9 @@ private:
 
   static int on_stream_close_callback(nghttp2_session* session, int32_t stream_id, uint32_t error_code, void* user_data)
   {
+    (void)session;
+    (void)stream_id;
+    (void)user_data;
     if (error_code == 0) {
       return 0;
     }
@@ -397,6 +409,8 @@ public:
 
   IOState tryConnect(bool fastOpen, const ComboAddress& remote) override
   {
+    (void)fastOpen;
+    (void)remote;
     auto step = getStep();
     BOOST_REQUIRE_EQUAL(step.request, ExpectedStep::ExpectedRequest::connectToBackend);
 
@@ -441,6 +455,7 @@ public:
 
   void setSession(std::unique_ptr<TLSSession>& session) override
   {
+    (void)session;
   }
 
   std::vector<int> getAsyncFDs() override
@@ -455,15 +470,26 @@ public:
 
   void connect(bool fastOpen, const ComboAddress& remote, const struct timeval& timeout) override
   {
+    (void)fastOpen;
+    (void)remote;
+    (void)timeout;
   }
 
   size_t read(void* buffer, size_t bufferSize, const struct timeval& readTimeout, const struct timeval& totalTimeout = {0, 0}, bool allowIncomplete = false) override
   {
+    (void)buffer;
+    (void)bufferSize;
+    (void)readTimeout;
+    (void)totalTimeout;
+    (void)allowIncomplete;
     return 0;
   }
 
   size_t write(const void* buffer, size_t bufferSize, const struct timeval& writeTimeout) override
   {
+    (void)buffer;
+    (void)bufferSize;
+    (void)writeTimeout;
     return 0;
   }
 
@@ -780,10 +806,12 @@ BOOST_FIXTURE_TEST_CASE(test_ConnectionReuse, TestFixture)
     {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, std::numeric_limits<size_t>::max()},
     /* acknowledge settings */
     {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max(), [&firstQueryDone](int desc) {
+       (void)desc;
        firstQueryDone = true;
      }},
     /* headers */
     {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max(), [](int desc) {
+       (void)desc;
      }},
     /* data */
     {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max(), [](int desc) {
@@ -794,6 +822,7 @@ BOOST_FIXTURE_TEST_CASE(test_ConnectionReuse, TestFixture)
     {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, std::numeric_limits<size_t>::max()},
     /* later the backend sends a go away frame */
     {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, std::numeric_limits<size_t>::max(), [](int desc) {
+       (void)desc;
        s_connectionBuffers.at(desc)->submitGoAway();
      }},
     {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
@@ -867,6 +896,7 @@ BOOST_FIXTURE_TEST_CASE(test_InvalidDNSAnswer, TestFixture)
   auto sender = std::make_shared<MockupQuerySender>();
   sender->d_id = counter;
   sender->d_customHandler = [](uint16_t id, const struct timeval&, TCPResponse&& resp) {
+    (void)id;
     BOOST_CHECK_EQUAL(resp.d_buffer.size(), 11U);
     /* simulate an exception, since DoH and UDP frontends will process the query right away,
        while TCP and DoT will first pass it back to the TCP worker thread */
@@ -966,6 +996,7 @@ BOOST_FIXTURE_TEST_CASE(test_TimeoutWhileWriting, TestFixture)
     {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
     /* data */
     {ExpectedStep::ExpectedRequest::writeToBackend, IOState::NeedWrite, std::numeric_limits<size_t>::max(), [&timeout](int desc) {
+       (void)desc;
        timeout = true;
      }},
     {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
@@ -1053,6 +1084,7 @@ BOOST_FIXTURE_TEST_CASE(test_TimeoutWhileReading, TestFixture)
     {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
     /* data */
     {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max(), [&timeout](int desc) {
+       (void)desc;
        /* set the timeout flag now, since the timeout occurs while waiting for the descriptor to become readable */
        timeout = true;
      }},
@@ -1717,6 +1749,7 @@ BOOST_FIXTURE_TEST_CASE(test_WrongStreamID, TestFixture)
     {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
     /* read ends up as a time out since nghttp2 filters the frame with the wrong stream ID */
     {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0, [&timeout](int desc) {
+       (void)desc;
        /* set the timeout flag now, since the timeout occurs while waiting for the descriptor to become readable */
        timeout = true;
      }},
index b6f9bdd10bb21482d9eaf7741410796298674ae6..afcdc38d26ebb56be0ffefd6148b06bf0169ebd3 100644 (file)
@@ -30,16 +30,22 @@ public:
 
   std::unique_ptr<TLSConnection> getConnection(int socket, const struct timeval& timeout, time_t now) override
   {
+    (void)timeout;
+    (void)now;
     return std::make_unique<MockupTLSConnection>(socket);
   }
 
   std::unique_ptr<TLSConnection> getClientConnection(const std::string& host, bool hostIsAddr, int socket, const struct timeval& timeout) override
   {
+    (void)host;
+    (void)hostIsAddr;
+    (void)timeout;
     return std::make_unique<MockupTLSConnection>(socket, true, d_needProxyProtocol);
   }
 
   void rotateTicketsKey(time_t now) override
   {
+    (void)now;
   }
 
   size_t getTicketsKeysCount() override
@@ -68,6 +74,7 @@ public:
 
   int run(struct timeval* tv, int timeout = 500) override
   {
+    (void)timeout;
     int ret = 0;
 
     gettimeofday(tv, nullptr); // MANDATORY
@@ -97,14 +104,19 @@ public:
 
   void getAvailableFDs(std::vector<int>& fds, int timeout) override
   {
+    (void)fds;
+    (void)timeout;
   }
 
   void addFD(int fd, FDMultiplexer::EventKind kind) override
   {
+    (void)fd;
+    (void)kind;
   }
 
   void removeFD(int fd, FDMultiplexer::EventKind) override
   {
+    (void)fd;
   }
 
   string getName() const override
index 1bf6a66bb88ca0dd26fcdc8a1c04342e4ab2493c..ca8a3a773a1bad22b30c640acc672cbaafd90864 100644 (file)
@@ -38,21 +38,37 @@ const bool TCPIOHandler::s_disableConnectForUnitTests = true;
 
 bool checkDNSCryptQuery(const ClientState& cs, PacketBuffer& query, std::unique_ptr<DNSCryptQuery>& dnsCryptQuery, time_t now, bool tcp)
 {
+  (void)cs;
+  (void)query;
+  (void)dnsCryptQuery;
+  (void)now;
+  (void)tcp;
   return false;
 }
 
 bool checkQueryHeaders(const struct dnsheader& dnsHeader, ClientState& clientState)
 {
+  (void)dnsHeader;
+  (void)clientState;
   return true;
 }
 
 uint64_t uptimeOfProcess(const std::string& str)
 {
+  (void)str;
   return 0;
 }
 
 void handleResponseSent(const InternalQueryState& ids, double udiff, const ComboAddress& client, const ComboAddress& backend, unsigned int size, const dnsheader& cleartextDH, dnsdist::Protocol protocol, bool fromBackend)
 {
+  (void)ids;
+  (void)udiff;
+  (void)client;
+  (void)backend;
+  (void)size;
+  (void)cleartextDH;
+  (void)protocol;
+  (void)fromBackend;
 }
 
 void handleResponseSent(const DNSName& qname, const QType& qtype, double udiff, const ComboAddress& client, const ComboAddress& backend, unsigned int size, const dnsheader& cleartextDH, dnsdist::Protocol outgoingProtocol, dnsdist::Protocol incomingProtocol, bool fromBackend)
@@ -72,6 +88,12 @@ ProcessQueryResult processQuery(DNSQuestion& dnsQuestion, std::shared_ptr<Downst
 
 bool responseContentMatches(const PacketBuffer& response, const DNSName& qname, const uint16_t qtype, const uint16_t qclass, const std::shared_ptr<DownstreamState>& remote, bool allowEmptyResponse)
 {
+  (void)response;
+  (void)qname;
+  (void)qtype;
+  (void)qclass;
+  (void)remote;
+  (void)allowEmptyResponse;
   return true;
 }
 
@@ -164,6 +186,7 @@ public:
 
   IOState tryRead(PacketBuffer& buffer, size_t& pos, size_t toRead, bool allowIncomplete=false) override
   {
+    (void)allowIncomplete;
     auto step = getStep();
     BOOST_REQUIRE_EQUAL(step.request, !d_client ? ExpectedStep::ExpectedRequest::readFromClient : ExpectedStep::ExpectedRequest::readFromBackend);
 
@@ -193,6 +216,8 @@ public:
 
   IOState tryConnect(bool fastOpen, const ComboAddress& remote) override
   {
+    (void)fastOpen;
+    (void)remote;
     auto step = getStep();
     BOOST_REQUIRE_EQUAL(step.request, ExpectedStep::ExpectedRequest::connectToBackend);
 
@@ -242,6 +267,7 @@ public:
 
   void setSession(std::unique_ptr<TLSSession>& session) override
   {
+    (void)session;
   }
 
   /* unused in that context, don't bother */
@@ -251,15 +277,26 @@ public:
 
   void connect(bool fastOpen, const ComboAddress& remote, const struct timeval& timeout) override
   {
+    (void)fastOpen;
+    (void)remote;
+    (void)timeout;
   }
 
   size_t read(void* buffer, size_t bufferSize, const struct timeval&readTimeout, const struct timeval& totalTimeout={0,0}, bool allowIncomplete=false) override
   {
+    (void)buffer;
+    (void)bufferSize;
+    (void)readTimeout;
+    (void)totalTimeout;
+    (void)allowIncomplete;
     return 0;
   }
 
   size_t write(const void* buffer, size_t bufferSize, const struct timeval& writeTimeout) override
   {
+    (void)buffer;
+    (void)bufferSize;
+    (void)writeTimeout;
     return 0;
   }
 private:
@@ -289,16 +326,22 @@ public:
 
   std::unique_ptr<TLSConnection> getConnection(int socket, const struct timeval& timeout, time_t now) override
   {
+    (void)timeout;
+    (void)now;
     return std::make_unique<MockupTLSConnection>(socket);
   }
 
   std::unique_ptr<TLSConnection> getClientConnection(const std::string& host, bool hostIsAddr, int socket, const struct timeval& timeout) override
   {
+    (void)host;
+    (void)hostIsAddr;
+    (void)timeout;
     return std::make_unique<MockupTLSConnection>(socket, true);
   }
 
   void rotateTicketsKey(time_t now) override
   {
+    (void)now;
   }
 
   size_t getTicketsKeysCount() override
@@ -325,6 +368,7 @@ public:
 
   int run(struct timeval* tv, int timeout=500) override
   {
+    (void)timeout;
     int ret = 0;
 
     gettimeofday(tv, nullptr); // MANDATORY
@@ -355,14 +399,19 @@ public:
 
   void getAvailableFDs(std::vector<int>& fds, int timeout) override
   {
+    (void)fds;
+    (void)timeout;
   }
 
   void addFD(int fd, FDMultiplexer::EventKind kind) override
   {
+    (void)fd;
+    (void)kind;
   }
 
   void removeFD(int fd, FDMultiplexer::EventKind) override
   {
+    (void)fd;
   }
 
   string getName() const override
@@ -514,6 +563,8 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_SelfAnswered, TestFixture)
       { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
     };
     s_processQuery = [](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dq;
+      (void)selectedBackend;
       return ProcessQueryResult::Drop;
     };
 
@@ -536,6 +587,8 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_SelfAnswered, TestFixture)
       { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
     };
     s_processQuery = [](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dq;
+      (void)selectedBackend;
       // Would be nicer to actually turn it into a response
       return ProcessQueryResult::SendAnswer;
     };
@@ -568,6 +621,8 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_SelfAnswered, TestFixture)
       { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
     };
     s_processQuery = [](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dq;
+      (void)selectedBackend;
       // Would be nicer to actually turn it into a response
       return ProcessQueryResult::SendAnswer;
     };
@@ -596,6 +651,8 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_SelfAnswered, TestFixture)
       { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
     };
     s_processQuery = [](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dq;
+      (void)selectedBackend;
       throw std::runtime_error("Something unexpected happened");
     };
 
@@ -623,6 +680,8 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_SelfAnswered, TestFixture)
     s_steps.push_back({ ExpectedStep::ExpectedRequest::closeClient, IOState::Done });
 
     s_processQuery = [](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dq;
+      (void)selectedBackend;
       // Would be nicer to actually turn it into a response
       return ProcessQueryResult::SendAnswer;
     };
@@ -645,6 +704,8 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_SelfAnswered, TestFixture)
       { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
     };
     s_processQuery = [](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dq;
+      (void)selectedBackend;
       /* should not be reached */
       BOOST_CHECK(false);
       return ProcessQueryResult::SendAnswer;
@@ -683,6 +744,8 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_SelfAnswered, TestFixture)
       { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
     };
     s_processQuery = [](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dq;
+      (void)selectedBackend;
       return ProcessQueryResult::SendAnswer;
     };
 
@@ -719,6 +782,8 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_SelfAnswered, TestFixture)
       { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
     };
     s_processQuery = [](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dq;
+      (void)selectedBackend;
       return ProcessQueryResult::SendAnswer;
     };
 
@@ -780,6 +845,8 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionWithProxyProtocol_SelfAnswered, T
       { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
     };
     s_processQuery = [](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dq;
+      (void)selectedBackend;
       return ProcessQueryResult::SendAnswer;
     };
 
@@ -813,6 +880,8 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionWithProxyProtocol_SelfAnswered, T
       { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
     };
     s_processQuery = [](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dq;
+      (void)selectedBackend;
       return ProcessQueryResult::SendAnswer;
     };
 
@@ -843,6 +912,8 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionWithProxyProtocol_SelfAnswered, T
       { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
     };
     s_processQuery = [](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dq;
+      (void)selectedBackend;
       return ProcessQueryResult::SendAnswer;
     };
 
@@ -922,10 +993,14 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_BackendNoOOOR, TestFixture)
       { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
     };
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dq;
       selectedBackend = backend;
       return ProcessQueryResult::PassToBackend;
     };
     s_processResponse = [](PacketBuffer& response, DNSResponse& dr, bool muted) -> bool {
+      (void)response;
+      (void)dr;
+      (void)muted;
       return true;
     };
 
@@ -962,10 +1037,14 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_BackendNoOOOR, TestFixture)
       { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
     };
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dq;
       selectedBackend = backend;
       return ProcessQueryResult::PassToBackend;
     };
     s_processResponse = [](PacketBuffer& response, DNSResponse& dr, bool muted) -> bool {
+      (void)response;
+      (void)dr;
+      (void)muted;
       throw std::runtime_error("Unexpected error while processing the response");
     };
 
@@ -1001,10 +1080,14 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_BackendNoOOOR, TestFixture)
       { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
     };
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dq;
       selectedBackend = backend;
       return ProcessQueryResult::PassToBackend;
     };
     s_processResponse = [](PacketBuffer& response, DNSResponse& dr, bool muted) -> bool {
+      (void)response;
+      (void)dr;
+      (void)muted;
       return false;
     };
 
@@ -1044,10 +1127,14 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_BackendNoOOOR, TestFixture)
       { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
     };
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dq;
       selectedBackend = backend;
       return ProcessQueryResult::PassToBackend;
     };
     s_processResponse = [](PacketBuffer& response, DNSResponse& dr, bool muted) -> bool {
+      (void)response;
+      (void)dr;
+      (void)muted;
       return true;
     };
 
@@ -1072,9 +1159,14 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_BackendNoOOOR, TestFixture)
       { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
     };
     s_processQuery = [](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dq;
+      (void)selectedBackend;
       return ProcessQueryResult::SendAnswer;
     };
     s_processResponse = [](PacketBuffer& response, DNSResponse& dr, bool muted) -> bool {
+      (void)response;
+      (void)dr;
+      (void)muted;
       return true;
     };
 
@@ -1109,10 +1201,14 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_BackendNoOOOR, TestFixture)
       { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
     };
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dq;
       selectedBackend = backend;
       return ProcessQueryResult::PassToBackend;
     };
     s_processResponse = [](PacketBuffer& response, DNSResponse& dr, bool muted) -> bool {
+      (void)response;
+      (void)dr;
+      (void)muted;
       return true;
     };
 
@@ -1177,10 +1273,14 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_BackendNoOOOR, TestFixture)
     };
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dq;
       selectedBackend = backend;
       return ProcessQueryResult::PassToBackend;
     };
     s_processResponse = [](PacketBuffer& response, DNSResponse& dr, bool muted) -> bool {
+      (void)response;
+      (void)dr;
+      (void)muted;
       return true;
     };
 
@@ -1210,26 +1310,31 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_BackendNoOOOR, TestFixture)
       { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
       /* opening a connection to the backend (5 tries by default) */
       { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [](int descriptor) {
+          (void)descriptor;
           throw NetworkError("Connection refused by the backend");
         }
       },
       { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
       { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [](int descriptor) {
+          (void)descriptor;
           throw NetworkError("Connection refused by the backend");
         }
       },
       { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
       { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [](int descriptor) {
+          (void)descriptor;
           throw NetworkError("Connection refused by the backend");
         }
       },
       { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
       { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [](int descriptor) {
+          (void)descriptor;
           throw NetworkError("Connection refused by the backend");
         }
       },
       { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
       { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [](int descriptor) {
+          (void)descriptor;
           throw NetworkError("Connection refused by the backend");
         }
       },
@@ -1239,11 +1344,14 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_BackendNoOOOR, TestFixture)
     };
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
-
+      (void)dq;
       selectedBackend = backend;
       return ProcessQueryResult::PassToBackend;
     };
     s_processResponse = [](PacketBuffer& response, DNSResponse& dr, bool muted) -> bool {
+      (void)response;
+      (void)dr;
+      (void)muted;
       return true;
     };
 
@@ -1275,11 +1383,14 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_BackendNoOOOR, TestFixture)
     };
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
-
+      (void)dq;
       selectedBackend = backend;
       return ProcessQueryResult::PassToBackend;
     };
     s_processResponse = [](PacketBuffer& response, DNSResponse& dr, bool muted) -> bool {
+      (void)response;
+      (void)dr;
+      (void)muted;
       return true;
     };
 
@@ -1322,10 +1433,14 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_BackendNoOOOR, TestFixture)
     };
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dq;
       selectedBackend = backend;
       return ProcessQueryResult::PassToBackend;
     };
     s_processResponse = [](PacketBuffer& response, DNSResponse& dr, bool muted) -> bool {
+      (void)response;
+      (void)dr;
+      (void)muted;
       return true;
     };
 
@@ -1379,10 +1494,14 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_BackendNoOOOR, TestFixture)
     };
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dq;
       selectedBackend = backend;
       return ProcessQueryResult::PassToBackend;
     };
     s_processResponse = [](PacketBuffer& response, DNSResponse& dr, bool muted) -> bool {
+      (void)response;
+      (void)dr;
+      (void)muted;
       return true;
     };
 
@@ -1435,10 +1554,14 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_BackendNoOOOR, TestFixture)
     };
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dq;
       selectedBackend = backend;
       return ProcessQueryResult::PassToBackend;
     };
     s_processResponse = [](PacketBuffer& response, DNSResponse& dr, bool muted) -> bool {
+      (void)response;
+      (void)dr;
+      (void)muted;
       return true;
     };
 
@@ -1467,24 +1590,28 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_BackendNoOOOR, TestFixture)
       { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
       /* and now reconnection fails (1) */
       { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [](int descriptor) {
+          (void)descriptor;
           throw NetworkError("Connection refused by the backend");
         }
       },
       { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
       /* 2 */
       { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [](int descriptor) {
+          (void)descriptor;
           throw NetworkError("Connection refused by the backend");
         }
       },
       { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
       /* 3 */
       { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [](int descriptor) {
+          (void)descriptor;
           throw NetworkError("Connection refused by the backend");
         }
       },
       { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
       /* 4 */
       { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [](int descriptor) {
+          (void)descriptor;
           throw NetworkError("Connection refused by the backend");
         }
       },
@@ -1494,10 +1621,14 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_BackendNoOOOR, TestFixture)
     };
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dq;
       selectedBackend = backend;
       return ProcessQueryResult::PassToBackend;
     };
     s_processResponse = [](PacketBuffer& response, DNSResponse& dr, bool muted) -> bool {
+      (void)response;
+      (void)dr;
+      (void)muted;
       return true;
     };
 
@@ -1546,10 +1677,14 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_BackendNoOOOR, TestFixture)
     };
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dq;
       selectedBackend = backend;
       return ProcessQueryResult::PassToBackend;
     };
     s_processResponse = [](PacketBuffer& response, DNSResponse& dr, bool muted) -> bool {
+      (void)response;
+      (void)dr;
+      (void)muted;
       return true;
     };
 
@@ -1606,10 +1741,14 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_BackendNoOOOR, TestFixture)
     };
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dq;
       selectedBackend = backend;
       return ProcessQueryResult::PassToBackend;
     };
     s_processResponse = [](PacketBuffer& response, DNSResponse& dr, bool muted) -> bool {
+      (void)response;
+      (void)dr;
+      (void)muted;
       return true;
     };
 
@@ -1647,10 +1786,14 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_BackendNoOOOR, TestFixture)
     };
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dq;
       selectedBackend = backend;
       return ProcessQueryResult::PassToBackend;
     };
     s_processResponse = [](PacketBuffer& response, DNSResponse& dr, bool muted) -> bool {
+      (void)response;
+      (void)dr;
+      (void)muted;
       return true;
     };
 
@@ -1711,10 +1854,14 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_BackendNoOOOR, TestFixture)
     s_steps.push_back({ ExpectedStep::ExpectedRequest::closeClient, IOState::Done });
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dq;
       selectedBackend = backend;
       return ProcessQueryResult::PassToBackend;
     };
     s_processResponse = [](PacketBuffer& response, DNSResponse& dr, bool muted) -> bool {
+      (void)response;
+      (void)dr;
+      (void)muted;
       return true;
     };
 
@@ -1753,12 +1900,16 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_BackendNoOOOR, TestFixture)
     };
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dq;
       selectedBackend = backend;
       dq.asynchronous = true;
       /* note that we do nothing with the query, we just tell the frontend it was dealt with */
       return ProcessQueryResult::Asynchronous;
     };
     s_processResponse = [](PacketBuffer& response, DNSResponse& dr, bool muted) -> bool {
+      (void)response;
+      (void)dr;
+      (void)muted;
       return true;
     };
 
@@ -1941,10 +2092,14 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
     };
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dq;
       selectedBackend = backend;
       return ProcessQueryResult::PassToBackend;
     };
     s_processResponse = [](PacketBuffer& response, DNSResponse& dr, bool muted) -> bool {
+      (void)response;
+      (void)dr;
+      (void)muted;
       return true;
     };
 
@@ -2079,6 +2234,9 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
       return ProcessQueryResult::PassToBackend;
     };
     s_processResponse = [](PacketBuffer& response, DNSResponse& dr, bool muted) -> bool {
+      (void)response;
+      (void)dr;
+      (void)muted;
       return true;
     };
 
@@ -2204,6 +2362,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
       /* reading a query from the client (5) */
       { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
       { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(4).size() - 2, [&threadData,&backendDesc](int desc) {
+        (void)desc;
         /* set the backend descriptor as ready now */
         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(backendDesc);
       } },
@@ -2234,6 +2393,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
       /* reading a response from the backend (5) */
       { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
       { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(4).size() - 2, [&threadData](int desc) {
+        (void)desc;
         /* set the client descriptor as ready to resume sending */
         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(-1);
       } },
@@ -2257,10 +2417,14 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
     };
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dq;
       selectedBackend = backend;
       return ProcessQueryResult::PassToBackend;
     };
     s_processResponse = [](PacketBuffer& response, DNSResponse& dr, bool muted) -> bool {
+      (void)response;
+      (void)dr;
+      (void)muted;
       return true;
     };
 
@@ -2321,6 +2485,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
       { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(1).size() - 2 },
       /* query is dropped, closing the connection to the client */
       { ExpectedStep::ExpectedRequest::closeClient, IOState::Done, 0, [&timeout](int desc) {
+        (void)desc;
         timeout = true;
       } },
       /* closing a connection to the backend after a timeout */
@@ -2329,6 +2494,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
 
     counter = 0;
     s_processQuery = [backend,&counter](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dq;
       if (counter == 0) {
         ++counter;
         selectedBackend = backend;
@@ -2337,6 +2503,9 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
       return ProcessQueryResult::Drop;
     };
     s_processResponse = [](PacketBuffer& response, DNSResponse& dr, bool muted) -> bool {
+      (void)response;
+      (void)dr;
+      (void)muted;
       return true;
     };
 
@@ -2400,6 +2569,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
       { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(1).size() - 2 },
       /* query is dropped, closing the connection to the client */
       { ExpectedStep::ExpectedRequest::closeClient, IOState::Done, 0, [&threadData,&backendDescriptor](int desc) {
+        (void)desc;
         /* the backend descriptor becomes ready */
         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(backendDescriptor);
       } },
@@ -2412,6 +2582,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
 
     counter = 0;
     s_processQuery = [backend,&counter](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dq;
       if (counter == 0) {
         ++counter;
         selectedBackend = backend;
@@ -2420,6 +2591,9 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
       return ProcessQueryResult::Drop;
     };
     s_processResponse = [](PacketBuffer& response, DNSResponse& dr, bool muted) -> bool {
+      (void)response;
+      (void)dr;
+      (void)muted;
       return true;
     };
 
@@ -2524,6 +2698,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
       { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(4).size() - 2 },
       /* sending response (3) to the client */
       { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(4).size(), [&timeout](int desc) {
+        (void)desc;
         timeout = true;
       } },
       /* closing a connection to the backend */
@@ -2533,10 +2708,14 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
     };
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dq;
       selectedBackend = backend;
       return ProcessQueryResult::PassToBackend;
     };
     s_processResponse = [](PacketBuffer& response, DNSResponse& dr, bool muted) -> bool {
+      (void)response;
+      (void)dr;
+      (void)muted;
       return true;
     };
 
@@ -2649,30 +2828,36 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
       { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
       /* try opening a new connection to the backend, it fails (5) times */
       { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [](int desc) {
+        (void)desc;
         throw NetworkError("Connection refused by the backend");
       } },
       { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
       /* try opening a new connection to the backend, it fails (5) times */
       { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done,0, [](int desc) {
+        (void)desc;
         throw NetworkError("Connection refused by the backend");
       } },
       { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
       /* try opening a new connection to the backend, it fails (5) times */
       { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done,0, [](int desc) {
+        (void)desc;
         throw NetworkError("Connection refused by the backend");
       } },
       { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
       /* try opening a new connection to the backend, it fails (5) times */
       { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done,0, [](int desc) {
+        (void)desc;
         throw NetworkError("Connection refused by the backend");
       } },
       { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
       /* try opening a new connection to the backend, it fails (5) times */
       { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done,0, [](int desc) {
+        (void)desc;
         throw NetworkError("Connection refused by the backend");
       } },
       /* closing a connection to the backend, client becomes ready */
       { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done, 0, [&threadData](int desc) {
+        (void)desc;
         /* the client descriptor is ready */
         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(-1);
       } },
@@ -2685,10 +2870,14 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
     };
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dq;
       selectedBackend = backend;
       return ProcessQueryResult::PassToBackend;
     };
     s_processResponse = [](PacketBuffer& response, DNSResponse& dr, bool muted) -> bool {
+      (void)response;
+      (void)dr;
+      (void)muted;
       return true;
     };
 
@@ -2852,6 +3041,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
       } },
       /* no more query from the client for now */
       { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0 , [&threadData](int desc) {
+        (void)desc;
         /* the client descriptor becomes NOT ready */
         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(-1);
       } },
@@ -2870,6 +3060,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
       { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, axfrResponses.at(2).size() - 2 },
       /* sending response (3) to the client */
       { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, axfrResponses.at(2).size(), [&threadData](int desc) {
+        (void)desc;
         /* the client descriptor becomes ready */
         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(-1);
       } },
@@ -2892,10 +3083,14 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
     };
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dq;
       selectedBackend = backend;
       return ProcessQueryResult::PassToBackend;
     };
     s_processResponse = [](PacketBuffer& response, DNSResponse& dr, bool muted) -> bool {
+      (void)response;
+      (void)dr;
+      (void)muted;
       return true;
     };
 
@@ -3040,6 +3235,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
       } },
       /* no more query from the client for now */
       { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0 , [&threadData](int desc) {
+        (void)desc;
         /* the client descriptor becomes NOT ready */
         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(-1);
       } },
@@ -3066,10 +3262,14 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
     };
 
     s_processQuery = [proxyEnabledBackend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dq;
       selectedBackend = proxyEnabledBackend;
       return ProcessQueryResult::PassToBackend;
     };
     s_processResponse = [](PacketBuffer& response, DNSResponse& dr, bool muted) -> bool {
+      (void)response;
+      (void)dr;
+      (void)muted;
       return true;
     };
 
@@ -3295,6 +3495,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
       { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, firstResponse.size() - 2 },
       /* sending response (1) to the client */
       { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, firstResponse.size(), [&threadData](int desc) {
+        (void)desc;
         /* client descriptor becomes ready */
         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(-1);
       } },
@@ -3308,6 +3509,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
       { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, ixfrResponses.at(0).size() - 2 },
       /* sending response (ixfr 1) to the client */
       { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, ixfrResponses.at(0).size(), [&threadData](int desc) {
+        (void)desc;
         /* the client descriptor becomes ready */
         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(-1);
       } },
@@ -3330,10 +3532,14 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
     };
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dq;
       selectedBackend = backend;
       return ProcessQueryResult::PassToBackend;
     };
     s_processResponse = [](PacketBuffer& response, DNSResponse& dr, bool muted) -> bool {
+      (void)response;
+      (void)dr;
+      (void)muted;
       return true;
     };
 
@@ -3456,10 +3662,14 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
     };
 
     s_processQuery = [proxyEnabledBackend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dq;
       selectedBackend = proxyEnabledBackend;
       return ProcessQueryResult::PassToBackend;
     };
     s_processResponse = [](PacketBuffer& response, DNSResponse& dr, bool muted) -> bool {
+      (void)response;
+      (void)dr;
+      (void)muted;
       return true;
     };
 
@@ -3541,10 +3751,14 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
     };
 
     s_processQuery = [proxyEnabledBackend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dq;
       selectedBackend = proxyEnabledBackend;
       return ProcessQueryResult::PassToBackend;
     };
     s_processResponse = [](PacketBuffer& response, DNSResponse& dr, bool muted) -> bool {
+      (void)response;
+      (void)dr;
+      (void)muted;
       return true;
     };
 
@@ -3597,6 +3811,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
       /* reading a third query from the client */
       { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
       { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(2).size() - 2, [&timeout](int desc) {
+        (void)desc;
         timeout = true;
       } },
       /* trying to read more from the client but nothing to read */
@@ -3608,10 +3823,14 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
     };
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dq;
       selectedBackend = backend;
       return ProcessQueryResult::PassToBackend;
     };
     s_processResponse = [](PacketBuffer& response, DNSResponse& dr, bool muted) -> bool {
+      (void)response;
+      (void)dr;
+      (void)muted;
       return true;
     };
 
@@ -3727,6 +3946,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
       { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
       /* nothing more to read from the client at that moment */
       { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0, [&threadData, &backend1Desc](int desc) {
+        (void)desc;
         /* but the first backend becomes readable */
         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(backend1Desc);
       } },
@@ -3768,6 +3988,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
       { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(2).size() - 2 },
       /* sending it to the client */
       { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(2).size(), [&threadData,&backend1Desc,&backend2Desc](int desc) {
+        (void)desc;
         /* backend 2 is no longer readable, backend 1 becomes readable */
         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(backend2Desc);
         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(backend1Desc);
@@ -3777,6 +3998,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
       { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(4).size() - 2 },
       /* sending it to the client */
       { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(4).size(), [&threadData,&backend1Desc,&backend2Desc](int desc) {
+        (void)desc;
         /* backend 1 is no longer readable, backend 2 becomes readable */
         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(backend1Desc);
         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(backend2Desc);
@@ -3786,6 +4008,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
       { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(3).size() - 2 },
       /* sending it to the client */
       { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(3).size(), [&threadData,&backend2Desc](int desc) {
+        (void)desc;
         /* backend 2 is no longer readable */
         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(backend2Desc);
         /* client becomes readable */
@@ -3801,10 +4024,14 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
     };
 
     s_processQuery = [backend1](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dq;
       selectedBackend = backend1;
       return ProcessQueryResult::PassToBackend;
     };
     s_processResponse = [](PacketBuffer& response, DNSResponse& dr, bool muted) -> bool {
+      (void)response;
+      (void)dr;
+      (void)muted;
       return true;
     };
 
@@ -3877,6 +4104,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
       } },
       /* sending it to the client. we don't have anything else to send to the client, no new query from it either, until we time out */
       { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(0).size(), [&timeout](int desc) {
+        (void)desc;
         timeout = true;
       } },
       /* closing a connection to the backend */
@@ -3886,10 +4114,14 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
     };
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dq;
       selectedBackend = backend;
       return ProcessQueryResult::PassToBackend;
     };
     s_processResponse = [](PacketBuffer& response, DNSResponse& dr, bool muted) -> bool {
+      (void)response;
+      (void)dr;
+      (void)muted;
       return true;
     };
 
@@ -4065,6 +4297,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendNotOOOR, TestFixture)
       { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(4).size() },
       /* no response ready yet, client stops being readable, first backend has a response */
       { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0, [&threadData,&backendDescriptors](int desc) {
+        (void)desc;
         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(backendDescriptors.at(0));
       } },
       /* trying to read from the client but nothing yet */
@@ -4076,6 +4309,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendNotOOOR, TestFixture)
       { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size() - 2 },
       /* sending it to the client */
       { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(0).size(), [&threadData,&backendDescriptors](int desc) {
+        (void)desc;
         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(backendDescriptors.at(2));
       } },
       /* reading response (3) from the third backend (3) */
@@ -4083,6 +4317,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendNotOOOR, TestFixture)
       { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(2).size() - 2 },
       /* sending it to the client */
       { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(2).size(), [&threadData,&backendDescriptors](int desc) {
+        (void)desc;
         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(backendDescriptors.at(1));
       } },
       /* reading response (2) from the second backend (2) */
@@ -4090,6 +4325,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendNotOOOR, TestFixture)
       { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(1).size() - 2 },
       /* sending it to the client */
       { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(1).size(), [&threadData,&backendDescriptors](int desc) {
+        (void)desc;
         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(backendDescriptors.at(4));
       } },
       /* reading response (5) from the fifth backend (5) */
@@ -4097,6 +4333,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendNotOOOR, TestFixture)
       { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(4).size() - 2 },
       /* sending it to the client */
       { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(4).size(), [&threadData,&backendDescriptors](int desc) {
+        (void)desc;
         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(backendDescriptors.at(3));
       } },
       /* reading response (4) from the fourth backend (4) */
@@ -4104,6 +4341,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendNotOOOR, TestFixture)
       { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(3).size() - 2 },
       /* sending it to the client */
       { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(3).size(), [&threadData](int desc) {
+        (void)desc;
         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(-1);
       } },
       /* client closes the connection */
@@ -4119,10 +4357,14 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendNotOOOR, TestFixture)
     };
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+      (void)dq;
       selectedBackend = backend;
       return ProcessQueryResult::PassToBackend;
     };
     s_processResponse = [](PacketBuffer& response, DNSResponse& dr, bool muted) -> bool {
+      (void)response;
+      (void)dr;
+      (void)muted;
       return true;
     };
 
@@ -4162,6 +4404,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendNotOOOR, TestFixture)
                 { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
                 { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(1).size() - 2 },
                 { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0, [&timeout](int desc) {
+                  (void)desc;
                   timeout = true;
                 }},
                 /* close the connection with the client */
@@ -4175,6 +4418,9 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendNotOOOR, TestFixture)
       return ProcessQueryResult::Asynchronous;
     };
     s_processResponse = [](PacketBuffer& response, DNSResponse& dr, bool muted) -> bool {
+      (void)response;
+      (void)dr;
+      (void)muted;
       return true;
     };