]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
chore(dnsdist): Format all dnsdist files 16776/head
authorPieter Lexis <pieter.lexis@powerdns.com>
Mon, 26 Jan 2026 14:38:49 +0000 (15:38 +0100)
committerPieter Lexis <pieter.lexis@powerdns.com>
Mon, 26 Jan 2026 14:46:50 +0000 (15:46 +0100)
29 files changed:
.not-formatted
pdns/dnsdistdist/connection-management.hh
pdns/dnsdistdist/dnsdist-backend.cc
pdns/dnsdistdist/dnsdist-kvs.cc
pdns/dnsdistdist/dnsdist-kvs.hh
pdns/dnsdistdist/dnsdist-lbpolicies.cc
pdns/dnsdistdist/dnsdist-lua-bindings-kvs.cc
pdns/dnsdistdist/dnsdist-lua-bindings-packetcache.cc
pdns/dnsdistdist/dnsdist-lua-bindings-protobuf.cc
pdns/dnsdistdist/dnsdist-lua-ffi.cc
pdns/dnsdistdist/dnsdist-lua-web.cc
pdns/dnsdistdist/dnsdist-prometheus.hh
pdns/dnsdistdist/dnsdist-rules-generator.py
pdns/dnsdistdist/dnsdist-rust-lib/dnsdist-settings-generator.py
pdns/dnsdistdist/dnsdist-settings-documentation-generator.py
pdns/dnsdistdist/dnsdist-systemd.cc
pdns/dnsdistdist/dnsdist-tcp-downstream.cc
pdns/dnsdistdist/dnsdist-tcp-downstream.hh
pdns/dnsdistdist/dnsdist-tcp-upstream.hh
pdns/dnsdistdist/docs/conf.py
pdns/dnsdistdist/tcpiohandler-mplexer.hh
pdns/dnsdistdist/test-connectionmanagement_hh.cc
pdns/dnsdistdist/test-delaypipe_hh.cc
pdns/dnsdistdist/test-dnsdistdynblocks_hh.cc
pdns/dnsdistdist/test-dnsdistkvs_cc.cc
pdns/dnsdistdist/test-dnsdistrings_cc.cc
pdns/dnsdistdist/test-dnsdistrules_cc.cc
pdns/dnsdistdist/test-dnsdisttcp_cc.cc
pdns/dnsdistdist/testrunner.cc

index 417205f43c89a83da61042deef38c6a9fb42a94b..c12aa9e68ecaeaaa188e41078b19c712e6b28bf9 100644 (file)
 ./pdns/dns.hh
 ./pdns/dnsbulktest.cc
 ./pdns/dnsdemog.cc
-./pdns/dnsdistdist/connection-management.hh
-./pdns/dnsdistdist/dnsdist-backend.cc
-./pdns/dnsdistdist/dnsdist-kvs.cc
-./pdns/dnsdistdist/dnsdist-kvs.hh
-./pdns/dnsdistdist/dnsdist-lbpolicies.cc
-./pdns/dnsdistdist/dnsdist-lua-bindings-kvs.cc
-./pdns/dnsdistdist/dnsdist-lua-bindings-packetcache.cc
-./pdns/dnsdistdist/dnsdist-lua-bindings-protobuf.cc
-./pdns/dnsdistdist/dnsdist-lua-ffi.cc
-./pdns/dnsdistdist/dnsdist-lua-ffi.hh
-./pdns/dnsdistdist/dnsdist-lua-web.cc
-./pdns/dnsdistdist/dnsdist-prometheus.hh
-./pdns/dnsdistdist/dnsdist-rules.hh
-./pdns/dnsdistdist/dnsdist-systemd.cc
-./pdns/dnsdistdist/dnsdist-tcp-downstream.cc
-./pdns/dnsdistdist/dnsdist-tcp-downstream.hh
-./pdns/dnsdistdist/dnsdist-tcp-upstream.hh
-./pdns/dnsdistdist/dnsdist-web.hh
-./pdns/dnsdistdist/doh.cc
-./pdns/dnsdistdist/tcpiohandler-mplexer.hh
-./pdns/dnsdistdist/test-connectionmanagement_hh.cc
-./pdns/dnsdistdist/test-delaypipe_hh.cc
-./pdns/dnsdistdist/test-dnsdistdynblocks_hh.cc
-./pdns/dnsdistdist/test-dnsdistkvs_cc.cc
-./pdns/dnsdistdist/test-dnsdistrings_cc.cc
-./pdns/dnsdistdist/test-dnsdistrules_cc.cc
-./pdns/dnsdistdist/test-dnsdisttcp_cc.cc
-./pdns/dnsdistdist/testrunner.cc
 ./pdns/dnsgram.cc
 ./pdns/dnsname.cc
 ./pdns/dnsname.hh
index 3237f74b9811a5af5705e588e817dd5e57aa6683..bfc14431bd5a9c867526c187691de91b1d5b23cd 100644 (file)
@@ -57,7 +57,8 @@ public:
   }
 
 private:
-  struct Data {
+  struct Data
+  {
     size_t d_maxConcurrentConnections{0};
     size_t d_currentConnectionsCount{0};
   };
index 9e5f2c075ed5b222de0f8bf9182c8f31638d7ef3..455cf0421895b27e1792f1b3ea5f1ab54f8b5442 100644 (file)
@@ -56,7 +56,7 @@ void DownstreamState::addXSKDestination(int fd)
 {
   auto socklen = d_config.remote.getSocklen();
   ComboAddress local;
-    // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast): sorry, it's the API
+  // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast): sorry, it's the API
   if (getsockname(fd, reinterpret_cast<sockaddr*>(&local), &socklen) != 0) {
     return;
   }
@@ -162,8 +162,7 @@ bool DownstreamState::reconnect(bool initialAttempt)
         if (!IsAnyAddress(d_config.sourceAddr) || !d_config.sourceItfName.empty()) {
           SLOG(infolog("Error connecting to new server with address %s (source address: %s, source interface: %s): %s", d_config.remote.toStringWithPort(), IsAnyAddress(d_config.sourceAddr) ? "not set" : d_config.sourceAddr.toString(), d_config.sourceItfName.empty() ? "not set" : d_config.sourceItfName, error.what()),
                getLogger()->error(Logr::Info, error.what(), "Error connecting to server", "source.address", Logging::Loggable(d_config.sourceAddr), "source.interface", Logging::Loggable(d_config.sourceItfName)));
-
-          }
+        }
         else {
           SLOG(infolog("Error connecting to new server with address %s: %s", d_config.remote.toStringWithPort(), error.what()),
                getLogger()->error(Logr::Info, error.what(), "Error connecting to server"));
@@ -230,7 +229,7 @@ void DownstreamState::waitUntilConnected()
   }
   {
     std::unique_lock<std::mutex> lock(connectLock);
-    d_connectedWait.wait(lock, [this]{
+    d_connectedWait.wait(lock, [this] {
       return connected.load();
     });
   }
@@ -292,7 +291,7 @@ void DownstreamState::setWeight(int newWeight)
   if (newWeight < 1) {
     SLOG(errlog("Error setting server's weight: downstream weight value must be greater than 0."),
          getLogger()->info(Logr::Error, "Error setting server's weight: downstream weight value must be greater than 0", "backend.weight", Logging::Loggable(newWeight)));
-    return ;
+    return;
   }
 
   d_config.d_weight = newWeight;
@@ -302,7 +301,8 @@ void DownstreamState::setWeight(int newWeight)
   }
 }
 
-DownstreamState::DownstreamState(DownstreamState::Config&& config, std::shared_ptr<TLSCtx> tlsCtx, bool connect): d_config(std::move(config)), d_tlsCtx(std::move(tlsCtx))
+DownstreamState::DownstreamState(DownstreamState::Config&& config, std::shared_ptr<TLSCtx> tlsCtx, bool connect) :
+  d_config(std::move(config)), d_tlsCtx(std::move(tlsCtx))
 {
   threadStarted.clear();
 
@@ -352,7 +352,6 @@ DownstreamState::DownstreamState(DownstreamState::Config&& config, std::shared_p
   sw.start();
 }
 
-
 void DownstreamState::start()
 {
   if (connected && !threadStarted.test_and_set()) {
@@ -438,7 +437,7 @@ void DownstreamState::pickSocketsReadyForReceiving(std::vector<int>& ready)
 
   if (sockets.size() == 1) {
     ready.push_back(sockets[0]);
-    return ;
+    return;
   }
 
   (*mplexer.lock())->getAvailableFDs(ready, 1000);
@@ -510,7 +509,7 @@ void DownstreamState::handleUDPTimeouts()
   const auto udpTimeout = d_config.udpTimeout > 0 ? d_config.udpTimeout : config.d_udpTimeout;
   if (config.d_randomizeIDsToBackend) {
     auto map = d_idStatesMap.lock();
-    for (auto it = map->begin(); it != map->end(); ) {
+    for (auto it = map->begin(); it != map->end();) {
       auto& ids = it->second;
       if (isIDSExpired(ids, udpTimeout)) {
         handleUDPTimeout(ids);
@@ -577,8 +576,7 @@ uint16_t DownstreamState::saveState(InternalQueryState&& state)
       it->second.age.store(0);
 
       return it->first;
-    }
-    while (true);
+    } while (true);
   }
 
   do {
@@ -603,8 +601,7 @@ uint16_t DownstreamState::saveState(InternalQueryState&& state)
     ids.age.store(0);
     ids.inUse = true;
     return selectedID;
-  }
-  while (true);
+  } while (true);
 }
 
 void DownstreamState::restoreState(uint16_t id, InternalQueryState&& state)
@@ -764,7 +761,7 @@ time_t DownstreamState::getNextLazyHealthCheck()
 
 void DownstreamState::updateNextLazyHealthCheck(LazyHealthCheckStats& stats, bool checkScheduled, std::optional<time_t> currentTime)
 {
-  auto now = currentTime ? * currentTime : time(nullptr);
+  auto now = currentTime ? *currentTime : time(nullptr);
   if (d_config.d_lazyHealthCheckUseExponentialBackOff) {
     if (stats.d_status == DownstreamState::LazyHealthCheckStats::LazyStatus::PotentialFailure) {
       /* we are still in the "up" state, we need to send the next query quickly to
@@ -1050,7 +1047,7 @@ size_t ServerPool::countServers(bool upOnly) const
 {
   size_t count = 0;
   for (const auto& server : d_servers) {
-    if (!upOnly || std::get<1>(server)->isUp() ) {
+    if (!upOnly || std::get<1>(server)->isUp()) {
       count++;
     }
   }
@@ -1089,9 +1086,9 @@ void ServerPool::addServer(std::shared_ptr<DownstreamState>& server)
   auto count = static_cast<unsigned int>(d_servers.size());
   d_servers.emplace_back(++count, server);
   /* we need to reorder based on the server 'order' */
-  std::stable_sort(d_servers.begin(), d_servers.end(), [](const std::pair<unsigned int,std::shared_ptr<DownstreamState> >& lhs, const std::pair<unsigned int,std::shared_ptr<DownstreamState> >& rhs) {
-      return lhs.second->d_config.order < rhs.second->d_config.order;
-    });
+  std::stable_sort(d_servers.begin(), d_servers.end(), [](const std::pair<unsigned int, std::shared_ptr<DownstreamState>>& lhs, const std::pair<unsigned int, std::shared_ptr<DownstreamState>>& rhs) {
+    return lhs.second->d_config.order < rhs.second->d_config.order;
+  });
   /* and now we need to renumber for Lua (custom policies) */
   size_t idx = 1;
   for (auto& serv : d_servers) {
@@ -1115,7 +1112,8 @@ void ServerPool::removeServer(shared_ptr<DownstreamState>& server)
     else if (it->second == server) {
       it = d_servers.erase(it);
       found = true;
-    } else {
+    }
+    else {
       idx++;
       it++;
     }
index ff2b1a0af378d301353470e26f346adcafc81b00..4c0ba177d8c769d79d46f4cc9e09a9f831890381 100644 (file)
@@ -69,7 +69,7 @@ std::vector<std::string> KeyValueLookupKeySuffix::getKeys(const DNSName& qname)
   std::vector<std::string> result;
   result.reserve(labelsCount);
 
-  while(!lowerQName.isRoot()) {
+  while (!lowerQName.isRoot()) {
     result.emplace_back(d_wireFormat ? lowerQName.toDNSString() : lowerQName.toStringRootDot());
     labelsCount--;
     if (!lowerQName.chopOff() || labelsCount == 0) {
@@ -184,7 +184,8 @@ std::shared_ptr<const Logr::Logger> CDBKVStore::getLogger() const
   return dnsdist::logging::getTopLogger("cdb-key-value-store")->withValues("path", Logging::Loggable(d_fname));
 }
 
-CDBKVStore::CDBKVStore(const std::string& fname, time_t refreshDelay): d_fname(fname), d_refreshDelay(refreshDelay)
+CDBKVStore::CDBKVStore(const std::string& fname, time_t refreshDelay) :
+  d_fname(fname), d_refreshDelay(refreshDelay)
 {
   d_refreshing.clear();
 
@@ -196,7 +197,8 @@ CDBKVStore::CDBKVStore(const std::string& fname, time_t refreshDelay): d_fname(f
   refreshDBIfNeeded(now);
 }
 
-CDBKVStore::~CDBKVStore() {
+CDBKVStore::~CDBKVStore()
+{
 }
 
 bool CDBKVStore::reload(const struct stat& st)
index 42a9052577db8cc9a4b70494a1c4026fedb36ab9..6392401f5d5bcbc953725ec31d7736bf4f38a1f1 100644 (file)
@@ -35,10 +35,11 @@ public:
   virtual std::string toString() const = 0;
 };
 
-class KeyValueLookupKeySourceIP: public KeyValueLookupKey
+class KeyValueLookupKeySourceIP : public KeyValueLookupKey
 {
 public:
-  KeyValueLookupKeySourceIP(uint8_t v4Mask, uint8_t v6Mask, bool includePort): d_v4Mask(v4Mask), d_v6Mask(v6Mask), d_includePort(includePort)
+  KeyValueLookupKeySourceIP(uint8_t v4Mask, uint8_t v6Mask, bool includePort) :
+    d_v4Mask(v4Mask), d_v6Mask(v6Mask), d_includePort(includePort)
   {
   }
 
@@ -53,17 +54,18 @@ public:
   {
     return "source IP (masked to " + std::to_string(d_v4Mask) + " (v4) / " + std::to_string(d_v6Mask) + " (v6) bits)" + (d_includePort ? " including the port" : "");
   }
+
 private:
   uint8_t d_v4Mask;
   uint8_t d_v6Mask;
   bool d_includePort;
 };
 
-class KeyValueLookupKeyQName: public KeyValueLookupKey
+class KeyValueLookupKeyQName : public KeyValueLookupKey
 {
 public:
-
-  KeyValueLookupKeyQName(bool wireFormat): d_wireFormat(wireFormat)
+  KeyValueLookupKeyQName(bool wireFormat) :
+    d_wireFormat(wireFormat)
   {
   }
 
@@ -92,10 +94,11 @@ private:
   bool d_wireFormat;
 };
 
-class KeyValueLookupKeySuffix: public KeyValueLookupKey
+class KeyValueLookupKeySuffix : public KeyValueLookupKey
 {
 public:
-  KeyValueLookupKeySuffix(size_t minLabels, bool wireFormat): d_minLabels(minLabels), d_wireFormat(wireFormat)
+  KeyValueLookupKeySuffix(size_t minLabels, bool wireFormat) :
+    d_minLabels(minLabels), d_wireFormat(wireFormat)
   {
   }
 
@@ -119,10 +122,11 @@ private:
   bool d_wireFormat;
 };
 
-class KeyValueLookupKeyTag: public KeyValueLookupKey
+class KeyValueLookupKeyTag : public KeyValueLookupKey
 {
 public:
-  KeyValueLookupKeyTag(const std::string& tag): d_tag(tag)
+  KeyValueLookupKeyTag(const std::string& tag) :
+    d_tag(tag)
   {
   }
 
@@ -131,7 +135,7 @@ public:
     if (dq.ids.qTag) {
       const auto& it = dq.ids.qTag->find(d_tag);
       if (it != dq.ids.qTag->end()) {
-        return { it->second };
+        return {it->second};
       }
     }
     return {};
@@ -176,10 +180,11 @@ public:
 
 #include "ext/lmdb-safe/lmdb-safe.hh"
 
-class LMDBKVStore: public KeyValueStore
+class LMDBKVStore : public KeyValueStore
 {
 public:
-  LMDBKVStore(const std::string& fname, const std::string& dbName, bool noLock=false): d_env(getMDBEnv(fname.c_str(), noLock ? MDB_NOSUBDIR|MDB_RDONLY|MDB_NOLOCK : MDB_NOSUBDIR|MDB_RDONLY, 0600, 0)), d_dbi(d_env->openDB(dbName, 0)), d_fname(fname), d_dbName(dbName)
+  LMDBKVStore(const std::string& fname, const std::string& dbName, bool noLock = false) :
+    d_env(getMDBEnv(fname.c_str(), noLock ? MDB_NOSUBDIR | MDB_RDONLY | MDB_NOLOCK : MDB_NOSUBDIR | MDB_RDONLY, 0600, 0)), d_dbi(d_env->openDB(dbName, 0)), d_fname(fname), d_dbName(dbName)
   {
   }
 
@@ -202,7 +207,7 @@ private:
 
 #include "cdb.hh"
 
-class CDBKVStore: public KeyValueStore
+class CDBKVStore : public KeyValueStore
 {
 public:
   CDBKVStore(const std::string& fname, time_t refreshDelay);
index 8e2b3eec5ef4997445725cf0b8b3188cea5b0723..1138dd55987f50a898df2c1998d91fcc4e6cc0dc 100644 (file)
 #include "dns_random.hh"
 
 static constexpr size_t s_staticArrayCutOff = 16;
-template <typename T> using DynamicIndexArray = std::vector<std::pair<T, size_t>>;
-template <typename T> using StaticIndexArray = std::array<std::pair<T, size_t>, s_staticArrayCutOff>;
+template <typename T>
+using DynamicIndexArray = std::vector<std::pair<T, size_t>>;
+template <typename T>
+using StaticIndexArray = std::array<std::pair<T, size_t>, s_staticArrayCutOff>;
 
 static std::optional<ServerPolicy::SelectedServerPosition> getLeastOutstanding(const ServerPolicy::NumberedServerVector& servers)
 {
@@ -90,19 +92,21 @@ std::optional<ServerPolicy::SelectedServerPosition> firstAvailable(const ServerP
   return leastOutstanding(servers, dnsQuestion);
 }
 
-template <class T> static std::optional<ServerPolicy::SelectedServerPosition> getValRandom(const ServerPolicy::NumberedServerVector& servers, T& poss, const unsigned int val, const double targetLoad)
+template <class T>
+static std::optional<ServerPolicy::SelectedServerPosition> getValRandom(const ServerPolicy::NumberedServerVector& servers, T& poss, const unsigned int val, const double targetLoad)
 {
   constexpr int max = std::numeric_limits<int>::max();
   int sum = 0;
 
   size_t usableServers = 0;
   const auto weightedBalancingFactor = dnsdist::configuration::getImmutableConfiguration().d_weightedBalancingFactor;
-  for (const auto& server : servers) {      // w=1, w=10 -> 1, 11
+  for (const auto& server : servers) { // w=1, w=10 -> 1, 11
     if (server.second->isUp() && (weightedBalancingFactor == 0 || (static_cast<double>(server.second->outstanding.load()) <= (targetLoad * server.second->d_config.d_weight)))) {
       // Don't overflow sum when adding high weights
       if (server.second->d_config.d_weight > max - sum) {
         sum = max;
-      } else {
+      }
+      else {
         sum += server.second->d_config.d_weight;
       }
 
@@ -117,7 +121,7 @@ template <class T> static std::optional<ServerPolicy::SelectedServerPosition> ge
   }
 
   int randomVal = static_cast<int>(val % sum);
-  auto selected = std::upper_bound(poss.begin(), poss.begin() + usableServers, randomVal, [](int randomVal_, const typename T::value_type& serverPair) { return  randomVal_ < serverPair.first;});
+  auto selected = std::upper_bound(poss.begin(), poss.begin() + usableServers, randomVal, [](int randomVal_, const typename T::value_type& serverPair) { return randomVal_ < serverPair.first; });
   if (selected == poss.begin() + usableServers) {
     return std::nullopt;
   }
@@ -197,7 +201,7 @@ std::optional<ServerPolicy::SelectedServerPosition> chashedFromHash(const Server
     }
   }
 
-  for (const auto& serverPair: servers) {
+  for (const auto& serverPair : servers) {
     if (serverPair.second->isUp() && (consistentHashBalancingFactor == 0 || static_cast<double>(serverPair.second->outstanding.load()) <= (targetLoad * serverPair.second->d_config.d_weight))) {
       // make sure hashes have been computed
       if (!serverPair.second->hashesComputed) {
@@ -327,7 +331,7 @@ const ServerPool& createPoolIfNotExists(const string& poolName)
 
   if (!poolName.empty()) {
     VERBOSESLOG(infolog("Creating pool %s", poolName),
-               dnsdist::logging::getTopLogger("pool")->info(Logr::Info, "Creating a new pool of backends", "pool", Logging::Loggable(poolName)));
+                dnsdist::logging::getTopLogger("pool")->info(Logr::Info, "Creating a new pool of backends", "pool", Logging::Loggable(poolName)));
   }
 
   dnsdist::configuration::updateRuntimeConfiguration([&poolName](dnsdist::configuration::RuntimeConfiguration& config) {
@@ -346,10 +350,10 @@ void setPoolPolicy(const string& poolName, std::shared_ptr<ServerPolicy> policy)
   if (!poolName.empty()) {
     VERBOSESLOG(infolog("Setting pool %s server selection policy to %s", poolName, policy->getName()),
                 dnsdist::logging::getTopLogger("pool")->info(Logr::Info, "Setting pool server selection policy", "pool", Logging::Loggable(poolName), "policy", Logging::Loggable(policy->getName())));
-  } else {
+  }
+  else {
     VERBOSESLOG(infolog("Setting default pool server selection policy to %s", policy->getName()),
                 dnsdist::logging::getTopLogger("pool")->info(Logr::Info, "Setting pool server selection policy", "pool", Logging::Loggable(poolName), "policy", Logging::Loggable(policy->getName())));
-
   }
 
   dnsdist::configuration::updateRuntimeConfiguration([&poolName, &policy](dnsdist::configuration::RuntimeConfiguration& config) {
@@ -363,7 +367,8 @@ void addServerToPool(const string& poolName, std::shared_ptr<DownstreamState> se
   if (!poolName.empty()) {
     VERBOSESLOG(infolog("Adding server to pool %s", poolName),
                 dnsdist::logging::getTopLogger("pool")->info(Logr::Info, "Adding server to pool", "pool", Logging::Loggable(poolName)));
-  } else {
+  }
+  else {
     VERBOSESLOG(infolog("Adding server to default pool"),
                 dnsdist::logging::getTopLogger("pool")->info(Logr::Info, "Adding server to pool", "pool", Logging::Loggable(poolName)));
   }
@@ -402,7 +407,8 @@ const ServerPool& getPool(const std::string& poolName)
   return poolIt->second;
 }
 
-ServerPolicy::ServerPolicy(const std::string& name_, const std::string& code): d_name(name_), d_perThreadPolicyCode(code), d_isLua(true), d_isFFI(true), d_isPerThread(true)
+ServerPolicy::ServerPolicy(const std::string& name_, const std::string& code) :
+  d_name(name_), d_perThreadPolicyCode(code), d_isLua(true), d_isFFI(true), d_isPerThread(true)
 {
   LuaContext tmpContext;
   setupLuaLoadBalancingContext(tmpContext);
index e4101465e6b5f823fb64b576c036de44d1c5284d..1df5abbf1520cca612719870a9cdd9184a22b473 100644 (file)
@@ -58,7 +58,7 @@ void setupLuaBindingsKVS([[maybe_unused]] LuaContext& luaCtx, [[maybe_unused]] b
     return std::shared_ptr<KeyValueLookupKey>(new KeyValueLookupKeyTag(tag));
   });
 
-  luaCtx.registerFunction<std::string(std::shared_ptr<KeyValueStore>::*)(const boost::variant<ComboAddress, DNSName, std::string>, std::optional<bool> wireFormat)>("lookup", [](std::shared_ptr<KeyValueStore>& kvs, const boost::variant<ComboAddress, DNSName, std::string> keyVar, std::optional<bool> wireFormat) {
+  luaCtx.registerFunction<std::string (std::shared_ptr<KeyValueStore>::*)(const boost::variant<ComboAddress, DNSName, std::string>, std::optional<bool> wireFormat)>("lookup", [](std::shared_ptr<KeyValueStore>& kvs, const boost::variant<ComboAddress, DNSName, std::string> keyVar, std::optional<bool> wireFormat) {
     std::string result;
     if (!kvs) {
       return result;
@@ -90,7 +90,7 @@ void setupLuaBindingsKVS([[maybe_unused]] LuaContext& luaCtx, [[maybe_unused]] b
     return result;
   });
 
-  luaCtx.registerFunction<std::string(std::shared_ptr<KeyValueStore>::*)(const DNSName&, std::optional<size_t> minLabels, std::optional<bool> wireFormat)>("lookupSuffix", [](std::shared_ptr<KeyValueStore>& kvs, const DNSName& lookupKey, std::optional<size_t> minLabels, std::optional<bool> wireFormat) {
+  luaCtx.registerFunction<std::string (std::shared_ptr<KeyValueStore>::*)(const DNSName&, std::optional<size_t> minLabels, std::optional<bool> wireFormat)>("lookupSuffix", [](std::shared_ptr<KeyValueStore>& kvs, const DNSName& lookupKey, std::optional<size_t> minLabels, std::optional<bool> wireFormat) {
     std::string result;
     if (!kvs) {
       return result;
@@ -106,7 +106,7 @@ void setupLuaBindingsKVS([[maybe_unused]] LuaContext& luaCtx, [[maybe_unused]] b
     return result;
   });
 
-  luaCtx.registerFunction<bool(std::shared_ptr<KeyValueStore>::*)()>("reload", [](std::shared_ptr<KeyValueStore>& kvs) {
+  luaCtx.registerFunction<bool (std::shared_ptr<KeyValueStore>::*)()>("reload", [](std::shared_ptr<KeyValueStore>& kvs) {
     if (!kvs) {
       return false;
     }
index b772a511614e4c1f69952f871b7a23993e127e8d..ea72dd1d317541bffa0e3fd9212001422dee18c6 100644 (file)
@@ -32,8 +32,7 @@ void setupLuaBindingsPacketCache(LuaContext& luaCtx, bool client)
 {
   /* PacketCache */
   luaCtx.writeFunction("newPacketCache", [client](size_t maxEntries, std::optional<LuaAssociativeTable<boost::variant<bool, size_t, LuaArray<uint16_t>>>> vars) {
-
-    DNSDistPacketCache::CacheSettings settings {
+    DNSDistPacketCache::CacheSettings settings{
       .d_maxEntries = maxEntries,
       .d_shardCount = 20,
     };
@@ -105,132 +104,128 @@ void setupLuaBindingsPacketCache(LuaContext& luaCtx, bool client)
   });
 
 #ifndef DISABLE_PACKETCACHE_BINDINGS
-  luaCtx.registerFunction<std::string(std::shared_ptr<DNSDistPacketCache>::*)()const>("toString", [](const std::shared_ptr<DNSDistPacketCache>& cache) {
-      if (cache) {
-        return cache->toString();
-      }
-      return std::string();
-    });
-  luaCtx.registerFunction<bool(std::shared_ptr<DNSDistPacketCache>::*)()const>("isFull", [](const std::shared_ptr<DNSDistPacketCache>& cache) {
-      if (cache) {
-        return cache->isFull();
-      }
-      return false;
-    });
-  luaCtx.registerFunction<size_t(std::shared_ptr<DNSDistPacketCache>::*)(size_t)>("purgeExpired", [](std::shared_ptr<DNSDistPacketCache>& cache, size_t upTo) {
-      if (cache) {
-        const time_t now = time(nullptr);
-
-        return cache->purgeExpired(upTo, now);
-      }
-      return static_cast<size_t>(0);
-    });
-  luaCtx.registerFunction<size_t(std::shared_ptr<DNSDistPacketCache>::*)(size_t)>("expunge", [](std::shared_ptr<DNSDistPacketCache>& cache, size_t upTo) {
-      if (cache) {
-        return cache->expunge(upTo);
-      }
-      return static_cast<size_t>(0);
-    });
-  luaCtx.registerFunction<void(std::shared_ptr<DNSDistPacketCache>::*)(const boost::variant<DNSName, string>& dname, std::optional<uint16_t> qtype, std::optional<bool> suffixMatch)>("expungeByName", [](
-              std::shared_ptr<DNSDistPacketCache>& cache,
-              const boost::variant<DNSName, string>& dname,
-              std::optional<uint16_t> qtype,
-              std::optional<bool> suffixMatch) {
-                DNSName qname;
-                if (dname.type() == typeid(DNSName)) {
-                  qname = boost::get<DNSName>(dname);
-                }
-                if (dname.type() == typeid(string)) {
-                  qname = DNSName(boost::get<string>(dname));
-                }
-                if (cache) {
-                  g_outputBuffer+="Expunged " + std::to_string(cache->expungeByName(qname, qtype ? *qtype : QType(QType::ANY).getCode(), suffixMatch ? *suffixMatch : false)) + " records\n";
-                }
-    });
-  luaCtx.registerFunction<void(std::shared_ptr<DNSDistPacketCache>::*)()const>("printStats", [](const std::shared_ptr<DNSDistPacketCache>& cache) {
-      if (cache) {
-        g_outputBuffer="Entries: " + std::to_string(cache->getEntriesCount()) + "/" + std::to_string(cache->getMaxEntries()) + "\n";
-        g_outputBuffer+="Hits: " + std::to_string(cache->getHits()) + "\n";
-        g_outputBuffer+="Misses: " + std::to_string(cache->getMisses()) + "\n";
-        g_outputBuffer+="Deferred inserts: " + std::to_string(cache->getDeferredInserts()) + "\n";
-        g_outputBuffer+="Deferred lookups: " + std::to_string(cache->getDeferredLookups()) + "\n";
-        g_outputBuffer+="Lookup Collisions: " + std::to_string(cache->getLookupCollisions()) + "\n";
-        g_outputBuffer+="Insert Collisions: " + std::to_string(cache->getInsertCollisions()) + "\n";
-        g_outputBuffer+="TTL Too Shorts: " + std::to_string(cache->getTTLTooShorts()) + "\n";
-        g_outputBuffer+="Cleanup Count: " + std::to_string(cache->getCleanupCount()) + "\n";
-      }
-    });
-  luaCtx.registerFunction<LuaAssociativeTable<uint64_t>(std::shared_ptr<DNSDistPacketCache>::*)()const>("getStats", [](const std::shared_ptr<DNSDistPacketCache>& cache) {
-      LuaAssociativeTable<uint64_t> stats;
-      if (cache) {
-        stats["entries"] = cache->getEntriesCount();
-        stats["maxEntries"] = cache->getMaxEntries();
-        stats["hits"] = cache->getHits();
-        stats["misses"] = cache->getMisses();
-        stats["deferredInserts"] = cache->getDeferredInserts();
-        stats["deferredLookups"] = cache->getDeferredLookups();
-        stats["lookupCollisions"] = cache->getLookupCollisions();
-        stats["insertCollisions"] = cache->getInsertCollisions();
-        stats["ttlTooShorts"] = cache->getTTLTooShorts();
-        stats["cleanupCount"] = cache->getCleanupCount();
-      }
-      return stats;
-    });
+  luaCtx.registerFunction<std::string (std::shared_ptr<DNSDistPacketCache>::*)() const>("toString", [](const std::shared_ptr<DNSDistPacketCache>& cache) {
+    if (cache) {
+      return cache->toString();
+    }
+    return std::string();
+  });
+  luaCtx.registerFunction<bool (std::shared_ptr<DNSDistPacketCache>::*)() const>("isFull", [](const std::shared_ptr<DNSDistPacketCache>& cache) {
+    if (cache) {
+      return cache->isFull();
+    }
+    return false;
+  });
+  luaCtx.registerFunction<size_t (std::shared_ptr<DNSDistPacketCache>::*)(size_t)>("purgeExpired", [](std::shared_ptr<DNSDistPacketCache>& cache, size_t upTo) {
+    if (cache) {
+      const time_t now = time(nullptr);
 
-  luaCtx.registerFunction<LuaArray<DNSName>(std::shared_ptr<DNSDistPacketCache>::*)(const ComboAddress& addr)const>("getDomainListByAddress", [](const std::shared_ptr<DNSDistPacketCache>& cache, const ComboAddress& addr) {
-      LuaArray<DNSName> results;
-      if (!cache) {
-        return results;
-      }
+      return cache->purgeExpired(upTo, now);
+    }
+    return static_cast<size_t>(0);
+  });
+  luaCtx.registerFunction<size_t (std::shared_ptr<DNSDistPacketCache>::*)(size_t)>("expunge", [](std::shared_ptr<DNSDistPacketCache>& cache, size_t upTo) {
+    if (cache) {
+      return cache->expunge(upTo);
+    }
+    return static_cast<size_t>(0);
+  });
+  luaCtx.registerFunction<void (std::shared_ptr<DNSDistPacketCache>::*)(const boost::variant<DNSName, string>& dname, std::optional<uint16_t> qtype, std::optional<bool> suffixMatch)>("expungeByName", [](std::shared_ptr<DNSDistPacketCache>& cache, const boost::variant<DNSName, string>& dname, std::optional<uint16_t> qtype, std::optional<bool> suffixMatch) {
+    DNSName qname;
+    if (dname.type() == typeid(DNSName)) {
+      qname = boost::get<DNSName>(dname);
+    }
+    if (dname.type() == typeid(string)) {
+      qname = DNSName(boost::get<string>(dname));
+    }
+    if (cache) {
+      g_outputBuffer += "Expunged " + std::to_string(cache->expungeByName(qname, qtype ? *qtype : QType(QType::ANY).getCode(), suffixMatch ? *suffixMatch : false)) + " records\n";
+    }
+  });
+  luaCtx.registerFunction<void (std::shared_ptr<DNSDistPacketCache>::*)() const>("printStats", [](const std::shared_ptr<DNSDistPacketCache>& cache) {
+    if (cache) {
+      g_outputBuffer = "Entries: " + std::to_string(cache->getEntriesCount()) + "/" + std::to_string(cache->getMaxEntries()) + "\n";
+      g_outputBuffer += "Hits: " + std::to_string(cache->getHits()) + "\n";
+      g_outputBuffer += "Misses: " + std::to_string(cache->getMisses()) + "\n";
+      g_outputBuffer += "Deferred inserts: " + std::to_string(cache->getDeferredInserts()) + "\n";
+      g_outputBuffer += "Deferred lookups: " + std::to_string(cache->getDeferredLookups()) + "\n";
+      g_outputBuffer += "Lookup Collisions: " + std::to_string(cache->getLookupCollisions()) + "\n";
+      g_outputBuffer += "Insert Collisions: " + std::to_string(cache->getInsertCollisions()) + "\n";
+      g_outputBuffer += "TTL Too Shorts: " + std::to_string(cache->getTTLTooShorts()) + "\n";
+      g_outputBuffer += "Cleanup Count: " + std::to_string(cache->getCleanupCount()) + "\n";
+    }
+  });
+  luaCtx.registerFunction<LuaAssociativeTable<uint64_t> (std::shared_ptr<DNSDistPacketCache>::*)() const>("getStats", [](const std::shared_ptr<DNSDistPacketCache>& cache) {
+    LuaAssociativeTable<uint64_t> stats;
+    if (cache) {
+      stats["entries"] = cache->getEntriesCount();
+      stats["maxEntries"] = cache->getMaxEntries();
+      stats["hits"] = cache->getHits();
+      stats["misses"] = cache->getMisses();
+      stats["deferredInserts"] = cache->getDeferredInserts();
+      stats["deferredLookups"] = cache->getDeferredLookups();
+      stats["lookupCollisions"] = cache->getLookupCollisions();
+      stats["insertCollisions"] = cache->getInsertCollisions();
+      stats["ttlTooShorts"] = cache->getTTLTooShorts();
+      stats["cleanupCount"] = cache->getCleanupCount();
+    }
+    return stats;
+  });
 
-      int counter = 1;
-      auto domains = cache->getDomainsContainingRecords(addr);
-      results.reserve(domains.size());
-      for (auto& domain : domains) {
-        results.emplace_back(counter, std::move(domain));
-        counter++;
-      }
+  luaCtx.registerFunction<LuaArray<DNSName> (std::shared_ptr<DNSDistPacketCache>::*)(const ComboAddress& addr) const>("getDomainListByAddress", [](const std::shared_ptr<DNSDistPacketCache>& cache, const ComboAddress& addr) {
+    LuaArray<DNSName> results;
+    if (!cache) {
       return results;
-    });
+    }
 
-  luaCtx.registerFunction<LuaArray<ComboAddress>(std::shared_ptr<DNSDistPacketCache>::*)(const DNSName& domain)const>("getAddressListByDomain", [](const std::shared_ptr<DNSDistPacketCache>& cache, const DNSName& domain) {
-      LuaArray<ComboAddress> results;
-      if (!cache) {
-        return results;
-      }
+    int counter = 1;
+    auto domains = cache->getDomainsContainingRecords(addr);
+    results.reserve(domains.size());
+    for (auto& domain : domains) {
+      results.emplace_back(counter, std::move(domain));
+      counter++;
+    }
+    return results;
+  });
 
-      int counter = 1;
-      auto addresses = cache->getRecordsForDomain(domain);
-      results.reserve(addresses.size());
-      for (auto& address : addresses) {
-        results.emplace_back(counter, std::move(address));
-        counter++;
-      }
+  luaCtx.registerFunction<LuaArray<ComboAddress> (std::shared_ptr<DNSDistPacketCache>::*)(const DNSName& domain) const>("getAddressListByDomain", [](const std::shared_ptr<DNSDistPacketCache>& cache, const DNSName& domain) {
+    LuaArray<ComboAddress> results;
+    if (!cache) {
       return results;
-    });
+    }
 
-  luaCtx.registerFunction<void(std::shared_ptr<DNSDistPacketCache>::*)(const std::string& fname, std::optional<bool> rawResponse)const>("dump", [](const std::shared_ptr<DNSDistPacketCache>& cache, const std::string& fname, std::optional<bool> rawResponse) {
-      if (cache) {
+    int counter = 1;
+    auto addresses = cache->getRecordsForDomain(domain);
+    results.reserve(addresses.size());
+    for (auto& address : addresses) {
+      results.emplace_back(counter, std::move(address));
+      counter++;
+    }
+    return results;
+  });
 
-        int fd = open(fname.c_str(), O_CREAT | O_EXCL | O_WRONLY, 0660);
-        if (fd < 0) {
-          g_outputBuffer = "Error opening dump file for writing: " + stringerror() + "\n";
-          return;
-        }
+  luaCtx.registerFunction<void (std::shared_ptr<DNSDistPacketCache>::*)(const std::string& fname, std::optional<bool> rawResponse) const>("dump", [](const std::shared_ptr<DNSDistPacketCache>& cache, const std::string& fname, std::optional<bool> rawResponse) {
+    if (cache) {
 
-        uint64_t records = 0;
-        try {
-          records = cache->dump(fd, rawResponse? *rawResponse : false);
-        }
-        catch (const std::exception& e) {
-          close(fd);
-          throw;
-        }
+      int fd = open(fname.c_str(), O_CREAT | O_EXCL | O_WRONLY, 0660);
+      if (fd < 0) {
+        g_outputBuffer = "Error opening dump file for writing: " + stringerror() + "\n";
+        return;
+      }
 
+      uint64_t records = 0;
+      try {
+        records = cache->dump(fd, rawResponse ? *rawResponse : false);
+      }
+      catch (const std::exception& e) {
         close(fd);
-
-        g_outputBuffer += "Dumped " + std::to_string(records) + " records\n";
+        throw;
       }
-    });
+
+      close(fd);
+
+      g_outputBuffer += "Dumped " + std::to_string(records) + " records\n";
+    }
+  });
 #endif /* DISABLE_PACKETCACHE_BINDINGS */
 }
index f7c654b97fd894b6ef9f3b02e7a3d6e779400029..26a31e768257be2dee64d68ab082e93745da27cc 100644 (file)
@@ -73,10 +73,10 @@ void setupLuaBindingsProtoBuf(LuaContext& luaCtx, bool client, bool configCheck)
   });
 
   luaCtx.registerFunction<void (DNSDistProtoBufMessage::*)(std::optional<time_t> sec, std::optional<uint32_t> uSec)>("setProtobufResponseType",
-                                                                                                                         [](DNSDistProtoBufMessage& message, std::optional<time_t> sec, std::optional<uint32_t> uSec) {
-                                                                                                                           message.setType(pdns::ProtoZero::Message::MessageType::DNSResponseType);
-                                                                                                                           message.setQueryTime(sec ? *sec : 0, uSec ? *uSec : 0);
-                                                                                                                         });
+                                                                                                                     [](DNSDistProtoBufMessage& message, std::optional<time_t> sec, std::optional<uint32_t> uSec) {
+                                                                                                                       message.setType(pdns::ProtoZero::Message::MessageType::DNSResponseType);
+                                                                                                                       message.setQueryTime(sec ? *sec : 0, uSec ? *uSec : 0);
+                                                                                                                     });
 
   luaCtx.registerFunction<void (DNSDistProtoBufMessage::*)(const std::string& strQueryName, uint16_t uType, uint16_t uClass, uint32_t uTTL, const std::string& strBlob)>("addResponseRR", [](DNSDistProtoBufMessage& message, const std::string& strQueryName, uint16_t uType, uint16_t uClass, uint32_t uTTL, const std::string& strBlob) {
     message.addRR(DNSName(strQueryName), uType, uClass, uTTL, strBlob);
index ac1512d3a15eb3b8b45e709bfb11914651b425a4..9219e9bb89d7146d51442d6ff1fbc609d09a3800 100644 (file)
@@ -879,7 +879,6 @@ bool dnsdist_ffi_dnsquestion_set_async(dnsdist_ffi_dnsquestion_t* dq, uint16_t a
   catch (const std::exception& e) {
     VERBOSESLOG(infolog("Error in dnsdist_ffi_dnsquestion_set_async: %s", e.what()),
                 getLogger(__func__)->error(Logr::Info, e.what(), "Error turning query asynchronous"));
-
   }
   catch (...) {
     VERBOSESLOG(infolog("Exception in dnsdist_ffi_dnsquestion_set_async"),
@@ -1624,9 +1623,7 @@ size_t dnsdist_ffi_ring_get_entries(dnsdist_ffi_ring_entry_list_t** out)
     return 0;
   }
   auto list = std::make_unique<dnsdist_ffi_ring_entry_list_t>();
-  struct timespec now
-  {
-  };
+  struct timespec now{};
   gettime(&now);
 
   for (const auto& shard : g_rings.d_shards) {
@@ -1672,9 +1669,7 @@ size_t dnsdist_ffi_ring_get_entries_by_addr(const char* addr, dnsdist_ffi_ring_e
   }
 
   auto list = std::make_unique<dnsdist_ffi_ring_entry_list_t>();
-  struct timespec now
-  {
-  };
+  struct timespec now{};
   gettime(&now);
 
   auto compare = ComboAddress::addressOnlyEqual();
@@ -1718,9 +1713,7 @@ size_t dnsdist_ffi_ring_get_entries_by_mac(const char* addr, dnsdist_ffi_ring_en
   return 0;
 #else
   auto list = std::make_unique<dnsdist_ffi_ring_entry_list_t>();
-  struct timespec now
-  {
-  };
+  struct timespec now{};
   gettime(&now);
 
   for (const auto& shard : g_rings.d_shards) {
@@ -2155,7 +2148,7 @@ bool dnsdist_ffi_dynamic_blocks_smt_add(const char* suffix, const char* message,
     }
     catch (const PDNSException& exp) {
       SLOG(errlog("dnsdist_ffi_dynamic_blocks_smt_add: Unable to parse '%s': %s", suffix, exp.reason),
-                   getLogger(__func__)->error(Logr::Error, exp.reason, "Error parsing suffix", "suffix", Logging::Loggable(suffix)));
+           getLogger(__func__)->error(Logr::Error, exp.reason, "Error parsing suffix", "suffix", Logging::Loggable(suffix)));
       return false;
     }
 
@@ -2188,7 +2181,6 @@ bool dnsdist_ffi_dynamic_blocks_smt_add(const char* suffix, const char* message,
   catch (...) {
     SLOG(errlog("Exception in dnsdist_ffi_dynamic_blocks_smt_add"),
          getLogger(__func__)->info(Logr::Error, "Unknown exception adding a dynamic SMT rule", "suffix", Logging::Loggable(suffix)));
-
   }
   return false;
 }
@@ -2392,7 +2384,6 @@ void dnsdist_ffi_svc_record_parameters_add_ipv4_hint(dnsdist_ffi_svc_record_para
   catch (const std::exception& exp) {
     SLOG(errlog("Exception in dnsdist_ffi_svc_record_parameters_add_ipv4_hint: %s", exp.what()),
          getLogger(__func__)->error(Logr::Error, exp.what(), "Exception adding IPv4 hint to SVC record"));
-
   }
   catch (const PDNSException& exp) {
     SLOG(errlog("Exception in dnsdist_ffi_svc_record_parameters_add_ipv4_hint: %s", exp.reason),
@@ -2466,7 +2457,7 @@ void dnsdist_ffi_dnsquestion_meta_begin_key([[maybe_unused]] dnsdist_ffi_dnsques
   dnsQuestion->pbfWriter = protozero::pbf_writer{dnsQuestion->dq->ids.d_rawProtobufContent};
   dnsQuestion->pbfMetaWriter = protozero::pbf_writer{dnsQuestion->pbfWriter, static_cast<protozero::pbf_tag_type>(pdns::ProtoZero::Message::Field::meta)};
   dnsQuestion->pbfMetaWriter.add_string(static_cast<protozero::pbf_tag_type>(pdns::ProtoZero::Message::MetaField::key), protozero::data_view(key, keyLen));
-  dnsQuestion->pbfMetaValueWriter = protozero::pbf_writer {dnsQuestion->pbfMetaWriter, static_cast<protozero::pbf_tag_type>(pdns::ProtoZero::Message::MetaField::value)};
+  dnsQuestion->pbfMetaValueWriter = protozero::pbf_writer{dnsQuestion->pbfMetaWriter, static_cast<protozero::pbf_tag_type>(pdns::ProtoZero::Message::MetaField::value)};
 #endif /* DISABLE_PROTOBUF */
 }
 
@@ -2546,7 +2537,7 @@ void dnsdist_ffi_dnsresponse_meta_begin_key([[maybe_unused]] dnsdist_ffi_dnsresp
   dnsResponse->pbfWriter = protozero::pbf_writer{dnsResponse->dr->ids.d_rawProtobufContent};
   dnsResponse->pbfMetaWriter = protozero::pbf_writer{dnsResponse->pbfWriter, static_cast<protozero::pbf_tag_type>(pdns::ProtoZero::Message::Field::meta)};
   dnsResponse->pbfMetaWriter.add_string(static_cast<protozero::pbf_tag_type>(pdns::ProtoZero::Message::MetaField::key), protozero::data_view(key, keyLen));
-  dnsResponse->pbfMetaValueWriter = protozero::pbf_writer {dnsResponse->pbfMetaWriter, static_cast<protozero::pbf_tag_type>(pdns::ProtoZero::Message::MetaField::value)};
+  dnsResponse->pbfMetaValueWriter = protozero::pbf_writer{dnsResponse->pbfMetaWriter, static_cast<protozero::pbf_tag_type>(pdns::ProtoZero::Message::MetaField::value)};
 #endif /* DISABLE_PROTOBUF */
 }
 
index d3f476cefbc871288ae896895685f59157835f77..d31bbdfcb78cfa0b1f517946ea03d046d5652c0d 100644 (file)
@@ -47,22 +47,19 @@ void setupLuaWeb([[maybe_unused]] LuaContext& luaCtx)
     for (const auto& entry : req.getvars) {
       values.insert({entry.first, entry.second});
     }
-    return values;
-  }, [](YaHTTP::Request& req, const LuaAssociativeTable<std::string>& values) { (void)req; (void)values; });
+    return 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)req; (void)values; });
+    return 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)req; (void)values; });
+    return 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; });
@@ -72,12 +69,10 @@ void setupLuaWeb([[maybe_unused]] LuaContext& luaCtx)
     for (const auto& entry : resp.headers) {
       values.insert({entry.first, entry.second});
     }
-    return values;
-  }, [](YaHTTP::Response& resp, const LuaAssociativeTable<std::string>& values) {
+    return values; }, [](YaHTTP::Response& resp, const LuaAssociativeTable<std::string>& values) {
     resp.headers.clear();
     for (const auto& entry : values) {
       resp.headers.insert({entry.first, entry.second});
-    }
-  });
+    } });
 #endif /* DISABLE_LUA_WEB_HANDLERS */
 }
index ed46c4f9ad7e1eb9045208778e67abd6cc368fa1..1e271841221737dad70b649f6c36de02e8390acc 100644 (file)
@@ -38,14 +38,18 @@ struct PrometheusMetricDefinition
 
 #ifndef DISABLE_PROMETHEUS
 // Metric types for Prometheus
-enum class PrometheusMetricType: uint8_t {
-    counter = 1,
-    gauge = 2
+enum class PrometheusMetricType : uint8_t
+{
+  counter = 1,
+  gauge = 2
 };
 
 // Keeps additional information about metrics
-struct MetricDefinition {
-  MetricDefinition(PrometheusMetricType _prometheusType, const std::string& _description, const std::string& customName_ = ""): description(_description), customName(customName_), prometheusType(_prometheusType) {
+struct MetricDefinition
+{
+  MetricDefinition(PrometheusMetricType _prometheusType, const std::string& _description, const std::string& customName_ = "") :
+    description(_description), customName(customName_), prometheusType(_prometheusType)
+  {
   }
 
   MetricDefinition() = default;
@@ -58,9 +62,11 @@ struct MetricDefinition {
   PrometheusMetricType prometheusType{PrometheusMetricType::counter};
 };
 
-struct MetricDefinitionStorage {
+struct MetricDefinitionStorage
+{
   // Return metric definition by name
-  bool getMetricDetails(const std::string& metricName, MetricDefinition& metric) const {
+  bool getMetricDetails(const std::string& metricName, MetricDefinition& metric) const
+  {
     const auto& metricDetailsIter = metrics.find(metricName);
 
     if (metricDetailsIter == metrics.end()) {
@@ -71,10 +77,11 @@ struct MetricDefinitionStorage {
     return true;
   };
 
-  static bool addMetricDefinition(const dnsdist::prometheus::PrometheusMetricDefinition& def) {
+  static bool addMetricDefinition(const dnsdist::prometheus::PrometheusMetricDefinition& def)
+  {
     static const std::map<std::string, PrometheusMetricType> namesToTypes = {
       {"counter", PrometheusMetricType::counter},
-      {"gauge",   PrometheusMetricType::gauge},
+      {"gauge", PrometheusMetricType::gauge},
     };
     auto realtype = namesToTypes.find(def.type);
     if (realtype == namesToTypes.end()) {
@@ -85,17 +92,18 @@ struct MetricDefinitionStorage {
   }
 
   // Return string representation of Prometheus metric type
-  std::string getPrometheusStringMetricType(PrometheusMetricType metricType) const {
+  std::string getPrometheusStringMetricType(PrometheusMetricType metricType) const
+  {
     switch (metricType) {
-      case PrometheusMetricType::counter:
-        return "counter";
-        break;
-      case PrometheusMetricType::gauge:
-        return "gauge";
-        break;
-      default:
-        return "";
-        break;
+    case PrometheusMetricType::counter:
+      return "counter";
+      break;
+    case PrometheusMetricType::gauge:
+      return "gauge";
+      break;
+    default:
+      return "";
+      break;
     }
   };
 
index be46a338585ea1dedcfa451de36762eaa8532de0..a12b5aad4a23294b62cb9c8bdc6040c8c197fc8e 100644 (file)
@@ -1,5 +1,6 @@
 #!/usr/bin/python3
 """Load action and selector definitions and generates C++ factory and Lua bindings code."""
+
 # 1/ Loads the action definitions from:
 # - dnsdist-actions-definitions.yml
 # - dnsdist-response-actions-definitions.yml
@@ -37,46 +38,50 @@ import sys
 import tempfile
 import yaml
 
+
 def get_definitions_from_file(def_file):
-    with open(def_file, 'rt', encoding="utf-8") as fd:
+    with open(def_file, "rt", encoding="utf-8") as fd:
         definitions = yaml.safe_load(fd.read())
         return definitions
 
+
 def is_vector_of(type_str):
-    return type_str.startswith('Vec<')
+    return type_str.startswith("Vec<")
+
 
 def type_to_cpp(type_str, lua_interface, inside_container=False):
     if is_vector_of(type_str):
         sub_type = type_str[4:-1]
-        return 'std::vector<' + type_to_cpp(sub_type, lua_interface, True) + '>'
-
-    if type_str == 'u8':
-        return 'uint8_t'
-    if type_str == 'u16':
-        return 'uint16_t'
-    if type_str == 'u32':
-        return 'uint32_t'
-    if type_str == 'u64':
-        return 'uint64_t'
-    if type_str == 'f64':
-        return 'double'
-    if type_str == 'String':
+        return "std::vector<" + type_to_cpp(sub_type, lua_interface, True) + ">"
+
+    if type_str == "u8":
+        return "uint8_t"
+    if type_str == "u16":
+        return "uint16_t"
+    if type_str == "u32":
+        return "uint32_t"
+    if type_str == "u64":
+        return "uint64_t"
+    if type_str == "f64":
+        return "double"
+    if type_str == "String":
         if lua_interface:
-            return 'std::string'
+            return "std::string"
         if inside_container:
-            return 'std::string'
-        return 'const std::string&'
-    if type_str == 'RCode':
-        return 'uint8_t'
-    if type_str == 'Opcode':
-        return 'uint8_t'
+            return "std::string"
+        return "const std::string&"
+    if type_str == "RCode":
+        return "uint8_t"
+    if type_str == "Opcode":
+        return "uint8_t"
     return type_str
 
+
 def get_cpp_object_name(name, is_class=True):
-    object_name = ''
+    object_name = ""
     capitalize = is_class
     for char in name:
-        if char == '-':
+        if char == "-":
             capitalize = True
             continue
         if capitalize:
@@ -86,216 +91,253 @@ def get_cpp_object_name(name, is_class=True):
 
     return object_name
 
+
 def get_cpp_parameter_name(name):
     return get_cpp_object_name(name, is_class=False)
 
+
 def get_cpp_parameters_definition(parameters, lua_interface):
-    output = ''
+    output = ""
     for parameter in parameters:
-        pname = get_cpp_parameter_name(parameter['name'])
-        ptype = type_to_cpp(parameter['type'], lua_interface)
-        if 'default' in parameter:
+        pname = get_cpp_parameter_name(parameter["name"])
+        ptype = type_to_cpp(parameter["type"], lua_interface)
+        if "default" in parameter:
             if lua_interface:
-                ptype = type_to_cpp(parameter['type'], lua_interface, True)
-                ptype = f'std::optional<{ptype}>'
-            elif not 'optional' in parameter or parameter['optional']:
-                ptype = type_to_cpp(parameter['type'], lua_interface, True)
-                ptype = f'std::optional<{ptype}>'
+                ptype = type_to_cpp(parameter["type"], lua_interface, True)
+                ptype = f"std::optional<{ptype}>"
+            elif not "optional" in parameter or parameter["optional"]:
+                ptype = type_to_cpp(parameter["type"], lua_interface, True)
+                ptype = f"std::optional<{ptype}>"
         if len(output) > 0:
-            output += ', '
-        output += f'{ptype} {pname}'
+            output += ", "
+        output += f"{ptype} {pname}"
     return output
 
+
 def get_cpp_parameters(parameters, lua_interface):
-    output = ''
+    output = ""
     for parameter in parameters:
-        pname = get_cpp_parameter_name(parameter['name'])
+        pname = get_cpp_parameter_name(parameter["name"])
         if len(output) > 0:
-            output += ', '
+            output += ", "
         default = None
-        if not 'default' in parameter:
-            output += f'{pname}'
+        if not "default" in parameter:
+            output += f"{pname}"
             continue
 
-        optional = not 'optional' in parameter or parameter['optional']
+        optional = not "optional" in parameter or parameter["optional"]
         if lua_interface and not optional:
             # We are the Lua binding, and the factory does not handle optional values
             # -> pass the value if any, and the default otherwise
-            default = parameter['default']
+            default = parameter["default"]
         elif not lua_interface and optional:
             # We are the C++ factory and we do handle optional values
             # -> pass the value if any, and the default otherwise
-            default = parameter['default']
+            default = parameter["default"]
         else:
             # We are the C++ factory and we do not handle optional values
             # -> pass the value we received
-            output += f'{pname}'
+            output += f"{pname}"
             continue
 
-        if default == '':
+        if default == "":
             default = '""'
         if default is True:
-            default = '{}'
+            default = "{}"
 
-        output += f'{pname} ? *{pname} : {default}'
+        output += f"{pname} ? *{pname} : {default}"
 
     return output
 
+
 def get_temporary_file_for_generated_code(dest_dir):
-    generated_fp = tempfile.NamedTemporaryFile(mode='w+t', encoding='utf-8', dir=dest_dir, delete=False)
-    generated_fp.write('// !! This file has been generated by dnsdist-rules-generator.py, do not edit by hand!!\n')
+    generated_fp = tempfile.NamedTemporaryFile(
+        mode="w+t", encoding="utf-8", dir=dest_dir, delete=False
+    )
+    generated_fp.write(
+        "// !! This file has been generated by dnsdist-rules-generator.py, do not edit by hand!!\n"
+    )
     return generated_fp
 
+
 def handle_generated_file(generated_file_name, output_file_name, build_dir):
-    build_dir_file = f'{build_dir}/{output_file_name}'
+    build_dir_file = f"{build_dir}/{output_file_name}"
     os.rename(generated_file_name, build_dir_file)
 
+
 def generate_actions_factory_header(definitions, build_dir, response=False):
-    suffix = 'ResponseAction' if response else 'Action'
-    shared_object_type = f'DNS{suffix}'
+    suffix = "ResponseAction" if response else "Action"
+    shared_object_type = f"DNS{suffix}"
     generated_fp = get_temporary_file_for_generated_code(build_dir)
 
     for action in definitions:
-        if 'skip-cpp' in action and action['skip-cpp']:
+        if "skip-cpp" in action and action["skip-cpp"]:
             continue
-        name = get_cpp_object_name(action['name'])
-        output = f'std::shared_ptr<{shared_object_type}> get{name}{suffix}('
-        if 'parameters' in action:
-            output += get_cpp_parameters_definition(action['parameters'], False)
-        output += ');\n'
+        name = get_cpp_object_name(action["name"])
+        output = f"std::shared_ptr<{shared_object_type}> get{name}{suffix}("
+        if "parameters" in action:
+            output += get_cpp_parameters_definition(action["parameters"], False)
+        output += ");\n"
         generated_fp.write(output)
 
-    output_file_name = 'dnsdist-response-actions-factory-generated.hh' if response else 'dnsdist-actions-factory-generated.hh'
+    output_file_name = (
+        "dnsdist-response-actions-factory-generated.hh"
+        if response
+        else "dnsdist-actions-factory-generated.hh"
+    )
     handle_generated_file(generated_fp.name, output_file_name, build_dir)
 
+
 def generate_actions_factory(definitions, build_dir, response=False):
-    suffix = 'ResponseAction' if response else 'Action'
+    suffix = "ResponseAction" if response else "Action"
     generated_fp = get_temporary_file_for_generated_code(build_dir)
 
     for action in definitions:
-        if 'skip-cpp' in action and action['skip-cpp']:
+        if "skip-cpp" in action and action["skip-cpp"]:
             continue
-        name = get_cpp_object_name(action['name'])
-        output = f'std::shared_ptr<DNS{suffix}> get{name}{suffix}('
-        if 'parameters' in action:
-            output += get_cpp_parameters_definition(action['parameters'], False)
-        output += ')\n{\n'
-        output += f'  return std::shared_ptr<DNS{suffix}>(new {name}{suffix}('
-        if 'parameters' in action:
-            output += get_cpp_parameters(action['parameters'], False)
-        output += '));\n'
-        output += '}\n'
+        name = get_cpp_object_name(action["name"])
+        output = f"std::shared_ptr<DNS{suffix}> get{name}{suffix}("
+        if "parameters" in action:
+            output += get_cpp_parameters_definition(action["parameters"], False)
+        output += ")\n{\n"
+        output += f"  return std::shared_ptr<DNS{suffix}>(new {name}{suffix}("
+        if "parameters" in action:
+            output += get_cpp_parameters(action["parameters"], False)
+        output += "));\n"
+        output += "}\n"
         generated_fp.write(output)
 
-    output_file_name = 'dnsdist-response-actions-factory-generated-body.hh' if response else 'dnsdist-actions-factory-generated-body.hh'
+    output_file_name = (
+        "dnsdist-response-actions-factory-generated-body.hh"
+        if response
+        else "dnsdist-actions-factory-generated-body.hh"
+    )
     handle_generated_file(generated_fp.name, output_file_name, build_dir)
 
+
 def generate_lua_actions_bindings(definitions, build_dir, response=False):
-    suffix = 'ResponseAction' if response else 'Action'
+    suffix = "ResponseAction" if response else "Action"
     generated_fp = get_temporary_file_for_generated_code(build_dir)
 
     for action in definitions:
-        if 'skip-cpp' in action and action['skip-cpp']:
+        if "skip-cpp" in action and action["skip-cpp"]:
             continue
-        if 'skip-lua' in action and action['skip-lua']:
+        if "skip-lua" in action and action["skip-lua"]:
             continue
-        name = get_cpp_object_name(action['name'])
+        name = get_cpp_object_name(action["name"])
         output = f'luaCtx.writeFunction("{name}{suffix}", []('
-        if 'parameters' in action:
-            output += get_cpp_parameters_definition(action['parameters'], True)
-        output += ') {\n'
-        output += f'  return dnsdist::actions::get{name}{suffix}('
-        if 'parameters' in action:
-            output += get_cpp_parameters(action['parameters'], True)
-        output += ');\n'
-        output += '});\n'
+        if "parameters" in action:
+            output += get_cpp_parameters_definition(action["parameters"], True)
+        output += ") {\n"
+        output += f"  return dnsdist::actions::get{name}{suffix}("
+        if "parameters" in action:
+            output += get_cpp_parameters(action["parameters"], True)
+        output += ");\n"
+        output += "});\n"
         generated_fp.write(output)
 
-    output_file_name = 'dnsdist-lua-response-actions-generated-body.hh' if response else 'dnsdist-lua-actions-generated-body.hh'
+    output_file_name = (
+        "dnsdist-lua-response-actions-generated-body.hh"
+        if response
+        else "dnsdist-lua-actions-generated-body.hh"
+    )
     handle_generated_file(generated_fp.name, output_file_name, build_dir)
 
+
 def generate_selectors_factory_header(definitions, build_dir):
     generated_fp = get_temporary_file_for_generated_code(build_dir)
 
     for selector in definitions:
-        if 'skip-cpp' in selector and selector['skip-cpp']:
+        if "skip-cpp" in selector and selector["skip-cpp"]:
             continue
-        name = get_cpp_object_name(selector['name'])
-        output = f'std::shared_ptr<{name}Rule> get{name}Selector('
-        if 'parameters' in selector:
-            output += get_cpp_parameters_definition(selector['parameters'], False)
-        output += ');\n'
+        name = get_cpp_object_name(selector["name"])
+        output = f"std::shared_ptr<{name}Rule> get{name}Selector("
+        if "parameters" in selector:
+            output += get_cpp_parameters_definition(selector["parameters"], False)
+        output += ");\n"
         generated_fp.write(output)
 
-    output_file_name = 'dnsdist-selectors-factory-generated.hh'
+    output_file_name = "dnsdist-selectors-factory-generated.hh"
     handle_generated_file(generated_fp.name, output_file_name, build_dir)
 
+
 def generate_selectors_factory(definitions, build_dir):
     generated_fp = get_temporary_file_for_generated_code(build_dir)
 
     for selector in definitions:
-        if 'skip-cpp' in selector and selector['skip-cpp']:
+        if "skip-cpp" in selector and selector["skip-cpp"]:
             continue
-        name = get_cpp_object_name(selector['name'])
-        output = f'std::shared_ptr<{name}Rule> get{name}Selector('
-        if 'parameters' in selector:
-            output += get_cpp_parameters_definition(selector['parameters'], False)
-        output += ')\n{\n'
-        output += f'  return std::make_shared<{name}Rule>('
-        if 'parameters' in selector:
-            output += get_cpp_parameters(selector['parameters'], False)
-        output += ');\n'
-        output += '}\n'
+        name = get_cpp_object_name(selector["name"])
+        output = f"std::shared_ptr<{name}Rule> get{name}Selector("
+        if "parameters" in selector:
+            output += get_cpp_parameters_definition(selector["parameters"], False)
+        output += ")\n{\n"
+        output += f"  return std::make_shared<{name}Rule>("
+        if "parameters" in selector:
+            output += get_cpp_parameters(selector["parameters"], False)
+        output += ");\n"
+        output += "}\n"
         generated_fp.write(output)
 
-    output_file_name = 'dnsdist-selectors-factory-generated-body.hh'
+    output_file_name = "dnsdist-selectors-factory-generated-body.hh"
     handle_generated_file(generated_fp.name, output_file_name, build_dir)
 
+
 def generate_lua_selectors_bindings(definitions, build_dir):
     generated_fp = get_temporary_file_for_generated_code(build_dir)
 
     for selector in definitions:
-        if 'skip-cpp' in selector and selector['skip-cpp']:
+        if "skip-cpp" in selector and selector["skip-cpp"]:
             continue
-        if 'skip-lua' in selector and selector['skip-lua']:
+        if "skip-lua" in selector and selector["skip-lua"]:
             continue
-        name = get_cpp_object_name(selector['name'])
+        name = get_cpp_object_name(selector["name"])
         output = f'luaCtx.writeFunction("{name}Rule", []('
-        if 'parameters' in selector:
-            output += get_cpp_parameters_definition(selector['parameters'], True)
-        output += ') {\n'
-        output += f'  return std::shared_ptr<DNSRule>(dnsdist::selectors::get{name}Selector('
-        if 'parameters' in selector:
-            output += get_cpp_parameters(selector['parameters'], True)
-        output += '));\n'
-        output += '});\n'
+        if "parameters" in selector:
+            output += get_cpp_parameters_definition(selector["parameters"], True)
+        output += ") {\n"
+        output += (
+            f"  return std::shared_ptr<DNSRule>(dnsdist::selectors::get{name}Selector("
+        )
+        if "parameters" in selector:
+            output += get_cpp_parameters(selector["parameters"], True)
+        output += "));\n"
+        output += "});\n"
         generated_fp.write(output)
 
-    output_file_name = 'dnsdist-lua-selectors-generated-body.hh'
+    output_file_name = "dnsdist-lua-selectors-generated-body.hh"
     handle_generated_file(generated_fp.name, output_file_name, build_dir)
 
+
 def main():
     if len(sys.argv) != 3:
-        print(f'Usage: {sys.argv[0]} <path/to/source/dir> </path/to/build/dir>')
+        print(f"Usage: {sys.argv[0]} <path/to/source/dir> </path/to/build/dir>")
         sys.exit(1)
 
     source_dir = sys.argv[1]
     build_dir = sys.argv[2]
 
-    definitions = get_definitions_from_file(f'{source_dir}/dnsdist-actions-definitions.yml')
+    definitions = get_definitions_from_file(
+        f"{source_dir}/dnsdist-actions-definitions.yml"
+    )
     generate_actions_factory_header(definitions, build_dir)
     generate_actions_factory(definitions, build_dir)
     generate_lua_actions_bindings(definitions, build_dir)
 
-    definitions = get_definitions_from_file(f'{source_dir}/dnsdist-response-actions-definitions.yml')
+    definitions = get_definitions_from_file(
+        f"{source_dir}/dnsdist-response-actions-definitions.yml"
+    )
     generate_actions_factory_header(definitions, build_dir, response=True)
     generate_actions_factory(definitions, build_dir, response=True)
     generate_lua_actions_bindings(definitions, build_dir, response=True)
 
-    definitions = get_definitions_from_file(f'{source_dir}/dnsdist-selectors-definitions.yml')
+    definitions = get_definitions_from_file(
+        f"{source_dir}/dnsdist-selectors-definitions.yml"
+    )
     generate_selectors_factory_header(definitions, build_dir)
     generate_selectors_factory(definitions, build_dir)
     generate_lua_selectors_bindings(definitions, build_dir)
 
-if __name__ == '__main__':
+
+if __name__ == "__main__":
     main()
index 3152107ceee75532d8f9733aa712e177e5f7b43b..b4d58176c73ba469d7309d95f78d701aa5c28d2c 100644 (file)
@@ -50,46 +50,53 @@ import sys
 import tempfile
 import yaml
 
+
 def quote(arg):
     """Return a quoted string"""
     return '"' + arg + '"'
 
+
 def get_vector_sub_type(rust_type):
     return rust_type[4:-1]
 
+
 def is_vector_of(rust_type):
-    return rust_type.startswith('Vec<')
+    return rust_type.startswith("Vec<")
+
 
 def is_type_native(rust_type):
     if is_vector_of(rust_type):
         sub_type = get_vector_sub_type(rust_type)
         return is_type_native(sub_type)
-    return rust_type in ['bool', 'u8', 'u16', 'u32', 'u64', 'f64', 'String']
+    return rust_type in ["bool", "u8", "u16", "u32", "u64", "f64", "String"]
+
 
 def is_value_rust_default(rust_type, value):
     """Is a value the same as its corresponding Rust default?"""
-    if rust_type == 'bool':
-        return value == 'false'
-    if rust_type  in ('u8', 'u16', 'u32', 'u64'):
-        return value in (0, '0', '')
-    if rust_type == 'f64':
-        return value in ('0.0', 0.0)
-    if rust_type == 'String':
-        return value == ''
-    if rust_type == 'Vec<String>':
-        return value == '' or value == '[]'
+    if rust_type == "bool":
+        return value == "false"
+    if rust_type in ("u8", "u16", "u32", "u64"):
+        return value in (0, "0", "")
+    if rust_type == "f64":
+        return value in ("0.0", 0.0)
+    if rust_type == "String":
+        return value == ""
+    if rust_type == "Vec<String>":
+        return value == "" or value == "[]"
     if is_vector_of(rust_type):
-        return value == '[]'
+        return value == "[]"
     return False
 
+
 def get_rust_field_name(name):
-    return name.replace('-', '_').lower()
+    return name.replace("-", "_").lower()
+
 
 def get_rust_object_name(name):
-    object_name = ''
+    object_name = ""
     capitalize = True
     for char in name:
-        if char in ['-', '_']:
+        if char in ["-", "_"]:
             capitalize = True
             continue
         if capitalize:
@@ -99,95 +106,105 @@ def get_rust_object_name(name):
 
     return object_name
 
+
 def gen_rust_vec_default_functions(name, type_name, def_value):
     """Generate Rust code for the default handling of a vector for type_name"""
-    ret = f'// DEFAULT HANDLING for {name}\n'
-    ret += f'fn default_value_{name}() -> Vec<dnsdistsettings::{type_name}> {{\n'
+    ret = f"// DEFAULT HANDLING for {name}\n"
+    ret += f"fn default_value_{name}() -> Vec<dnsdistsettings::{type_name}> {{\n"
     ret += f'    let msg = "default value defined for `{name}\' should be valid YAML";'
-    ret += f'    let deserialized: Vec<dnsdistsettings::{type_name}> = serde_yaml::from_str({quote(def_value)}).expect(&msg);\n'
-    ret += '    deserialized\n'
-    ret += '}\n'
-    ret += f'fn default_value_equal_{name}(value: &Vec<dnsdistsettings::{type_name}>)'
-    ret += '-> bool {\n'
-    ret += f'    let def = default_value_{name}();\n'
-    ret += '    &def == value\n'
-    ret += '}\n\n'
+    ret += f"    let deserialized: Vec<dnsdistsettings::{type_name}> = serde_yaml::from_str({quote(def_value)}).expect(&msg);\n"
+    ret += "    deserialized\n"
+    ret += "}\n"
+    ret += f"fn default_value_equal_{name}(value: &Vec<dnsdistsettings::{type_name}>)"
+    ret += "-> bool {\n"
+    ret += f"    let def = default_value_{name}();\n"
+    ret += "    &def == value\n"
+    ret += "}\n\n"
     return ret
 
+
 # Example snippet generated
 # fn default_value_general_query_local_address() -> Vec<String> {
 #    vec![String::from("0.0.0.0"), ]
-#}
-#fn default_value_equal_general_query_local_address(value: &Vec<String>) -> bool {
+# }
+# fn default_value_equal_general_query_local_address(value: &Vec<String>) -> bool {
 #    let def = default_value_general_query_local_address();
 #    &def == value
-#}
+# }
 def gen_rust_stringvec_default_functions(default, name):
     """Generate Rust code for the default handling of a vector for Strings"""
-    ret = f'// DEFAULT HANDLING for {name}\n'
-    ret += f'fn default_value_{name}() -> Vec<String> {{\n'
-    parts = re.split('[ \t,]+', default)
+    ret = f"// DEFAULT HANDLING for {name}\n"
+    ret += f"fn default_value_{name}() -> Vec<String> {{\n"
+    parts = re.split("[ \t,]+", default)
     if len(parts) > 0:
-        ret += '    vec![\n'
+        ret += "    vec![\n"
         for part in parts:
-            if part == '':
+            if part == "":
                 continue
-            ret += f'        String::from({quote(part)}),\n'
-        ret += '    ]\n'
+            ret += f"        String::from({quote(part)}),\n"
+        ret += "    ]\n"
     else:
-        ret  += '    vec![]\n'
-    ret += '}\n'
-    ret += f'fn default_value_equal_{name}(value: &Vec<String>) -> bool {{\n'
-    ret += f'    let def = default_value_{name}();\n'
-    ret += '    &def == value\n'
-    ret += '}\n\n'
+        ret += "    vec![]\n"
+    ret += "}\n"
+    ret += f"fn default_value_equal_{name}(value: &Vec<String>) -> bool {{\n"
+    ret += f"    let def = default_value_{name}();\n"
+    ret += "    &def == value\n"
+    ret += "}\n\n"
     return ret
 
+
 def gen_rust_default_functions(rust_type, default, name):
     """Generate Rust code for the default handling"""
-    if rust_type in ['Vec<String>']:
+    if rust_type in ["Vec<String>"]:
         return gen_rust_stringvec_default_functions(default, name)
-    ret = f'// DEFAULT HANDLING for {name}\n'
-    ret += f'fn default_value_{name}() -> {rust_type} {{\n'
+    ret = f"// DEFAULT HANDLING for {name}\n"
+    ret += f"fn default_value_{name}() -> {rust_type} {{\n"
     rustdef = quote(default)
     ret += f"    String::from({rustdef})\n"
-    ret += '}\n'
-    if rust_type == 'String':
-        rust_type = 'str'
-    ret += f'fn default_value_equal_{name}(value: &{rust_type})'
-    ret += '-> bool {\n'
-    ret += f'    value == default_value_{name}()\n'
-    ret += '}\n\n'
+    ret += "}\n"
+    if rust_type == "String":
+        rust_type = "str"
+    ret += f"fn default_value_equal_{name}(value: &{rust_type})"
+    ret += "-> bool {\n"
+    ret += f"    value == default_value_{name}()\n"
+    ret += "}\n\n"
     return ret
 
+
 def write_rust_default_trait_impl(struct, skip_namespace=False):
     """Generate Rust code for the default Trait for a structure"""
-    namespace = 'dnsdistsettings::' if not skip_namespace else ''
-    result = ''
-    result += f'impl Default for {namespace}{struct} {{\n'
-    result += '    fn default() -> Self {\n'
+    namespace = "dnsdistsettings::" if not skip_namespace else ""
+    result = ""
+    result += f"impl Default for {namespace}{struct} {{\n"
+    result += "    fn default() -> Self {\n"
     result += f'        let deserialized: {namespace}{struct} = serde_yaml::from_str("").unwrap();\n'
-    result += '        deserialized\n'
-    result += '    }\n'
-    result += '}\n\n'
+    result += "        deserialized\n"
+    result += "    }\n"
+    result += "}\n\n"
     return result
 
-def get_rust_serde_annotations(rust_type, default, rename, obj, field, default_functions):
-    rename_value = f'rename = "{rename}", ' if rename else ''
+
+def get_rust_serde_annotations(
+    rust_type, default, rename, obj, field, default_functions
+):
+    rename_value = f'rename = "{rename}", ' if rename else ""
     if default is None:
         if not rename_value:
-            return ''
-        return f'#[serde({rename_value})]'
+            return ""
+        return f"#[serde({rename_value})]"
     if default is True or is_value_rust_default(rust_type, default):
         return f'#[serde({rename_value}default, skip_serializing_if = "crate::is_default")]'
     type_upper = rust_type.capitalize()
-    if rust_type == 'bool':
-        return f'''#[serde({rename_value}default = "crate::{type_upper}::<{default}>::value", skip_serializing_if = "crate::if_true")]'''
-    if rust_type in ['String', 'Vec<String>']:
-        basename = obj + '_' + field
-        default_functions.append(gen_rust_default_functions(rust_type, default, basename))
-        return f'''#[serde({rename_value}default = "crate::default_value_{basename}", skip_serializing_if = "crate::default_value_equal_{basename}")]'''
-    return f'''#[serde({rename_value}default = "crate::{type_upper}::<{default}>::value", skip_serializing_if = "crate::{type_upper}::<{default}>::is_equal")]'''
+    if rust_type == "bool":
+        return f"""#[serde({rename_value}default = "crate::{type_upper}::<{default}>::value", skip_serializing_if = "crate::if_true")]"""
+    if rust_type in ["String", "Vec<String>"]:
+        basename = obj + "_" + field
+        default_functions.append(
+            gen_rust_default_functions(rust_type, default, basename)
+        )
+        return f"""#[serde({rename_value}default = "crate::default_value_{basename}", skip_serializing_if = "crate::default_value_equal_{basename}")]"""
+    return f"""#[serde({rename_value}default = "crate::{type_upper}::<{default}>::value", skip_serializing_if = "crate::{type_upper}::<{default}>::is_equal")]"""
+
 
 def get_converted_serde_type(rust_type):
     if is_type_native(rust_type):
@@ -195,126 +212,163 @@ def get_converted_serde_type(rust_type):
 
     if is_vector_of(rust_type):
         sub_type = get_vector_sub_type(rust_type)
-        if sub_type in ['Action', 'Selector']:
+        if sub_type in ["Action", "Selector"]:
             return rust_type
-        if sub_type in ['QueryRuleConfiguration', 'ResponseRuleConfiguration']:
-            return f'Vec<{sub_type}Serde>'
-        return f'Vec<dnsdistsettings::{sub_type}>'
-
-    return f'dnsdistsettings::{rust_type}'
-
-def get_rust_struct_fields_from_definition(name, keys, default_functions, indent, special_serde_object=False):
-    if not 'parameters' in keys:
-        return ''
-    output = ''
-    for parameter in keys['parameters']:
-        parameter_name = get_rust_field_name(parameter['name']) if not 'rename' in parameter else parameter['rename']
-        rust_type = parameter['type']
-        if 'rust-type' in parameter:
-            rust_type = parameter['rust-type']
+        if sub_type in ["QueryRuleConfiguration", "ResponseRuleConfiguration"]:
+            return f"Vec<{sub_type}Serde>"
+        return f"Vec<dnsdistsettings::{sub_type}>"
+
+    return f"dnsdistsettings::{rust_type}"
+
+
+def get_rust_struct_fields_from_definition(
+    name, keys, default_functions, indent, special_serde_object=False
+):
+    if not "parameters" in keys:
+        return ""
+    output = ""
+    for parameter in keys["parameters"]:
+        parameter_name = (
+            get_rust_field_name(parameter["name"])
+            if not "rename" in parameter
+            else parameter["rename"]
+        )
+        rust_type = parameter["type"]
+        if "rust-type" in parameter:
+            rust_type = parameter["rust-type"]
         if special_serde_object:
             rust_type = get_converted_serde_type(rust_type)
         else:
             # cxx does not support Enums, so we have to convert them to opaque types
-            if rust_type == 'Action':
-                rust_type = 'SharedDNSAction'
-            elif rust_type == 'ResponseAction':
-                rust_type = 'SharedDNSResponseAction'
-            elif rust_type == 'Selector':
-                rust_type = 'SharedDNSSelector'
-            elif rust_type == 'Vec<Selector>':
-                rust_type = 'Vec<SharedDNSSelector>'
-        rename = parameter['name'] if parameter_name != parameter['name'] else None
-        if special_serde_object or not 'skip-serde' in keys or not keys['skip-serde']:
-            default_str = get_rust_serde_annotations(rust_type, parameter['default'] if 'default' in parameter else None, rename, get_rust_field_name(name), parameter_name, default_functions)
+            if rust_type == "Action":
+                rust_type = "SharedDNSAction"
+            elif rust_type == "ResponseAction":
+                rust_type = "SharedDNSResponseAction"
+            elif rust_type == "Selector":
+                rust_type = "SharedDNSSelector"
+            elif rust_type == "Vec<Selector>":
+                rust_type = "Vec<SharedDNSSelector>"
+        rename = parameter["name"] if parameter_name != parameter["name"] else None
+        if special_serde_object or not "skip-serde" in keys or not keys["skip-serde"]:
+            default_str = get_rust_serde_annotations(
+                rust_type,
+                parameter["default"] if "default" in parameter else None,
+                rename,
+                get_rust_field_name(name),
+                parameter_name,
+                default_functions,
+            )
             if default_str:
-                output += indent + default_str + '\n'
-        output += f'{indent}{parameter_name}: {rust_type},\n'
+                output += indent + default_str + "\n"
+        output += f"{indent}{parameter_name}: {rust_type},\n"
 
     return output
 
-def get_rust_struct_from_definition(name, keys, default_functions, indent_spaces=4, special_serde_object=False):
-    if not 'parameters' in keys:
-        return ''
+
+def get_rust_struct_from_definition(
+    name, keys, default_functions, indent_spaces=4, special_serde_object=False
+):
+    if not "parameters" in keys:
+        return ""
     obj_name = get_rust_object_name(name)
-    indent = ' '*indent_spaces
-    output = ''
-    if special_serde_object or not 'skip-serde' in keys or not keys['skip-serde']:
-        output += f'''{indent}#[derive(Deserialize, Serialize, Debug, PartialEq)]
+    indent = " " * indent_spaces
+    output = ""
+    if special_serde_object or not "skip-serde" in keys or not keys["skip-serde"]:
+        output += f"""{indent}#[derive(Deserialize, Serialize, Debug, PartialEq)]
 {indent}#[serde(deny_unknown_fields)]
-'''
-    elif name == 'global':
-        output += f'{indent}#[derive(Default)]\n'
+"""
+    elif name == "global":
+        output += f"{indent}#[derive(Default)]\n"
 
-    name_suffix = 'Serde' if name == 'global' and special_serde_object else ''
-    output += f'''{indent}struct {obj_name}Configuration{name_suffix} {{
-'''
+    name_suffix = "Serde" if name == "global" and special_serde_object else ""
+    output += f"""{indent}struct {obj_name}Configuration{name_suffix} {{
+"""
     indent_spaces += 4
-    indent = ' '*indent_spaces
-    output += get_rust_struct_fields_from_definition(name, keys, default_functions, indent, special_serde_object=special_serde_object)
-    output += '    }\n'
-    if special_serde_object or not 'skip-serde' in keys or not keys['skip-serde']:
-        default_functions.append(write_rust_default_trait_impl(f'{obj_name}Configuration{name_suffix}', special_serde_object))
+    indent = " " * indent_spaces
+    output += get_rust_struct_fields_from_definition(
+        name, keys, default_functions, indent, special_serde_object=special_serde_object
+    )
+    output += "    }\n"
+    if special_serde_object or not "skip-serde" in keys or not keys["skip-serde"]:
+        default_functions.append(
+            write_rust_default_trait_impl(
+                f"{obj_name}Configuration{name_suffix}", special_serde_object
+            )
+        )
     return output
 
+
 def should_validate_type(rust_type):
     if is_vector_of(rust_type):
         sub_type = get_vector_sub_type(rust_type)
         return should_validate_type(sub_type)
-    if rust_type in ['bool', 'u8', 'u16', 'u32', 'u64', 'f64', 'String']:
+    if rust_type in ["bool", "u8", "u16", "u32", "u64", "f64", "String"]:
         return False
-    if rust_type in ['Action', 'Selector', 'dnsdistsettings::SelectorsConfiguration']:
+    if rust_type in ["Action", "Selector", "dnsdistsettings::SelectorsConfiguration"]:
         return False
     return True
 
+
 def get_validation_for_field(field_name, rust_type):
     if not should_validate_type(rust_type):
-        return ''
+        return ""
     if not is_vector_of(rust_type):
-        return f'        self.{field_name}.validate()?;\n'
+        return f"        self.{field_name}.validate()?;\n"
 
-    return f'''        for sub_type in &self.{field_name} {{
+    return f"""        for sub_type in &self.{field_name} {{
         sub_type.validate()?;
     }}
-'''
+"""
+
 
-def get_struct_validation_function_from_definition(name, parameters, special_serde_object=False):
+def get_struct_validation_function_from_definition(
+    name, parameters, special_serde_object=False
+):
     if len(parameters) == 0:
-        return ''
-    namespace = 'dnsdistsettings::' if not special_serde_object else ''
-    suffix = 'Serde' if special_serde_object else ''
+        return ""
+    namespace = "dnsdistsettings::" if not special_serde_object else ""
+    suffix = "Serde" if special_serde_object else ""
     struct_name = get_rust_object_name(name)
-    output = f'''impl {namespace}{struct_name}Configuration{suffix} {{
+    output = f"""impl {namespace}{struct_name}Configuration{suffix} {{
     fn validate(&self) -> Result<(), ValidationError> {{
-'''
+"""
     for parameter in parameters:
-        field_name = get_rust_field_name(parameter['name']) if parameter['name'] != 'namespace' else 'name_space'
-        rust_type = parameter['type']
+        field_name = (
+            get_rust_field_name(parameter["name"])
+            if parameter["name"] != "namespace"
+            else "name_space"
+        )
+        rust_type = parameter["type"]
         output += get_validation_for_field(field_name, rust_type)
-    output += '''        Ok(())
+    output += """        Ok(())
     }
-}'''
+}"""
     return output
 
+
 def get_definitions_from_file(def_file):
-    with open(def_file, 'rt', encoding="utf-8") as fd:
+    with open(def_file, "rt", encoding="utf-8") as fd:
         definitions = yaml.safe_load(fd.read())
         return definitions
 
+
 def include_file(out_fp, include_file_name):
-    with open(include_file_name, mode='r', encoding='utf-8') as in_fp:
+    with open(include_file_name, mode="r", encoding="utf-8") as in_fp:
         basename = os.path.basename(include_file_name)
-        out_fp.write(f'// START INCLUDE {basename}\n')
+        out_fp.write(f"// START INCLUDE {basename}\n")
         out_fp.write(in_fp.read())
-        out_fp.write(f'// END INCLUDE {basename}\n')
+        out_fp.write(f"// END INCLUDE {basename}\n")
+
 
 def generate_flat_settings_for_cxx(definitions, src_dir, out_file_path):
     cxx_flat_settings_fp = get_temporary_file_for_generated_code(out_file_path)
 
-    include_file(cxx_flat_settings_fp, src_dir + '/dnsdist-configuration-yaml-items-pre-in.cc')
+    include_file(
+        cxx_flat_settings_fp, src_dir + "/dnsdist-configuration-yaml-items-pre-in.cc"
+    )
 
     # first we do runtime-settable settings
-    cxx_flat_settings_fp.write('''#if defined(HAVE_YAML_CONFIGURATION)
+    cxx_flat_settings_fp.write("""#if defined(HAVE_YAML_CONFIGURATION)
 #include "rust/cxx.h"
 #include "rust/lib.rs.h"
 #include "dnsdist-configuration-yaml-internal.hh"
@@ -322,349 +376,441 @@ def generate_flat_settings_for_cxx(definitions, src_dir, out_file_path):
 namespace dnsdist::configuration::yaml
 {
 void convertRuntimeFlatSettingsFromRust(const dnsdist::rust::settings::GlobalConfiguration& yamlConfig, dnsdist::configuration::RuntimeConfiguration& config)
-{\n''')
+{\n""")
     for category_name, keys in definitions.items():
-        if not 'parameters' in keys:
+        if not "parameters" in keys:
             continue
 
-        if 'category' in keys:
-            category_name = keys['category']
+        if "category" in keys:
+            category_name = keys["category"]
         else:
             category_name = get_rust_field_name(category_name)
 
-        for parameter in keys['parameters']:
-            if not 'internal-field-name' in parameter or not 'runtime-configurable' in parameter or not parameter['runtime-configurable']:
+        for parameter in keys["parameters"]:
+            if (
+                not "internal-field-name" in parameter
+                or not "runtime-configurable" in parameter
+                or not parameter["runtime-configurable"]
+            ):
                 continue
-            internal_field_name = parameter['internal-field-name']
-            rust_field_name = get_rust_field_name(parameter['name']) if not 'rename' in parameter else parameter['rename']
-            default = parameter['default'] if parameter['type'] != 'String' else '"' + parameter['default'] + '"'
-            cxx_flat_settings_fp.write(f'  if (config.{internal_field_name} == {default}) {{\n')
-            if parameter['type'] != 'String':
-                cxx_flat_settings_fp.write(f'    config.{internal_field_name} = yamlConfig.{category_name}.{rust_field_name};\n')
+            internal_field_name = parameter["internal-field-name"]
+            rust_field_name = (
+                get_rust_field_name(parameter["name"])
+                if not "rename" in parameter
+                else parameter["rename"]
+            )
+            default = (
+                parameter["default"]
+                if parameter["type"] != "String"
+                else '"' + parameter["default"] + '"'
+            )
+            cxx_flat_settings_fp.write(
+                f"  if (config.{internal_field_name} == {default}) {{\n"
+            )
+            if parameter["type"] != "String":
+                cxx_flat_settings_fp.write(
+                    f"    config.{internal_field_name} = yamlConfig.{category_name}.{rust_field_name};\n"
+                )
             else:
-                cxx_flat_settings_fp.write(f'    config.{internal_field_name} = std::string(yamlConfig.{category_name}.{rust_field_name});\n')
-            cxx_flat_settings_fp.write('  }\n')
+                cxx_flat_settings_fp.write(
+                    f"    config.{internal_field_name} = std::string(yamlConfig.{category_name}.{rust_field_name});\n"
+                )
+            cxx_flat_settings_fp.write("  }\n")
 
-    cxx_flat_settings_fp.write('''}\n''')
+    cxx_flat_settings_fp.write("""}\n""")
 
     # then immutable ones
-    cxx_flat_settings_fp.write('''void convertImmutableFlatSettingsFromRust(const dnsdist::rust::settings::GlobalConfiguration& yamlConfig, dnsdist::configuration::ImmutableConfiguration& config)
-{\n''')
+    cxx_flat_settings_fp.write("""void convertImmutableFlatSettingsFromRust(const dnsdist::rust::settings::GlobalConfiguration& yamlConfig, dnsdist::configuration::ImmutableConfiguration& config)
+{\n""")
     for category_name, keys in definitions.items():
-        if not 'parameters' in keys:
+        if not "parameters" in keys:
             continue
 
-        if 'category' in keys:
-            category_name = keys['category']
+        if "category" in keys:
+            category_name = keys["category"]
         else:
             category_name = get_rust_field_name(category_name)
 
-        for parameter in keys['parameters']:
-            if not 'internal-field-name' in parameter or not 'runtime-configurable' in parameter or parameter['runtime-configurable']:
+        for parameter in keys["parameters"]:
+            if (
+                not "internal-field-name" in parameter
+                or not "runtime-configurable" in parameter
+                or parameter["runtime-configurable"]
+            ):
                 continue
-            internal_field_name = parameter['internal-field-name']
-            rust_field_name = get_rust_field_name(parameter['name']) if not 'rename' in parameter else parameter['rename']
-            default = parameter['default'] if parameter['type'] != 'String' else '"' + parameter['default'] + '"'
-            cxx_flat_settings_fp.write(f'  if (config.{internal_field_name} == {default}) {{\n')
-            if parameter['type'] != 'String':
-                cxx_flat_settings_fp.write(f'    config.{internal_field_name} = yamlConfig.{category_name}.{rust_field_name};\n')
+            internal_field_name = parameter["internal-field-name"]
+            rust_field_name = (
+                get_rust_field_name(parameter["name"])
+                if not "rename" in parameter
+                else parameter["rename"]
+            )
+            default = (
+                parameter["default"]
+                if parameter["type"] != "String"
+                else '"' + parameter["default"] + '"'
+            )
+            cxx_flat_settings_fp.write(
+                f"  if (config.{internal_field_name} == {default}) {{\n"
+            )
+            if parameter["type"] != "String":
+                cxx_flat_settings_fp.write(
+                    f"    config.{internal_field_name} = yamlConfig.{category_name}.{rust_field_name};\n"
+                )
             else:
-                cxx_flat_settings_fp.write(f'    config.{internal_field_name} = std::string(yamlConfig.{category_name}.{rust_field_name});\n')
-            cxx_flat_settings_fp.write('  }\n')
+                cxx_flat_settings_fp.write(
+                    f"    config.{internal_field_name} = std::string(yamlConfig.{category_name}.{rust_field_name});\n"
+                )
+            cxx_flat_settings_fp.write("  }\n")
 
-    cxx_flat_settings_fp.write('''}\n
+    cxx_flat_settings_fp.write("""}\n
 }
 #endif /* defined(HAVE_YAML_CONFIGURATION) */
-''')
+""")
+
+    os.rename(
+        cxx_flat_settings_fp.name,
+        out_file_path + "/dnsdist-configuration-yaml-items-generated.cc",
+    )
 
-    os.rename(cxx_flat_settings_fp.name, out_file_path + '/dnsdist-configuration-yaml-items-generated.cc')
 
 def generate_actions_config(output, def_dir, response, default_functions):
-    suffix = 'ResponseAction' if response else 'Action'
+    suffix = "ResponseAction" if response else "Action"
     actions_definitions = get_actions_definitions(def_dir, response)
-    action_buffer = ''
+    action_buffer = ""
     for action in actions_definitions:
-        name = get_rust_object_name(action['name'])
-        struct_name = f'{name}{suffix}Configuration'
-        indent = ' ' * 4
-        if not 'skip-serde' in action or not action['skip-serde']:
-            action_buffer += f'''{indent}#[derive(Deserialize, Serialize, Debug, PartialEq)]
-{indent}#[serde(deny_unknown_fields)]\n'''
+        name = get_rust_object_name(action["name"])
+        struct_name = f"{name}{suffix}Configuration"
+        indent = " " * 4
+        if not "skip-serde" in action or not action["skip-serde"]:
+            action_buffer += f"""{indent}#[derive(Deserialize, Serialize, Debug, PartialEq)]
+{indent}#[serde(deny_unknown_fields)]\n"""
         else:
-            action_buffer += f'{indent}#[derive(Default)]\n'
+            action_buffer += f"{indent}#[derive(Default)]\n"
 
-        action_buffer += f'{indent}struct {struct_name} {{\n'
+        action_buffer += f"{indent}struct {struct_name} {{\n"
 
-        indent = ' ' * 8
-        if not 'skip-serde' in action or not action['skip-serde']:
+        indent = " " * 8
+        if not "skip-serde" in action or not action["skip-serde"]:
             action_buffer += f'{indent}#[serde(default, skip_serializing_if = "crate::is_default")]\n'
-        action_buffer += f'{indent}name: String,\n'
+        action_buffer += f"{indent}name: String,\n"
 
-        action_buffer += get_rust_struct_fields_from_definition(struct_name, action, default_functions, indent)
+        action_buffer += get_rust_struct_fields_from_definition(
+            struct_name, action, default_functions, indent
+        )
 
-        action_buffer += '    }\n\n'
+        action_buffer += "    }\n\n"
 
     output.write(action_buffer)
 
+
 def generate_selectors_config(output, def_dir, default_functions):
-    suffix = 'Selector'
+    suffix = "Selector"
     selectors_definitions = get_selectors_definitions(def_dir)
-    selector_buffer = ''
+    selector_buffer = ""
     for selector in selectors_definitions:
-        name = get_rust_object_name(selector['name'])
-        struct_name = f'{name}{suffix}Configuration'
-        indent = ' ' * 4
-        if not 'skip-serde' in selector or not selector['skip-serde']:
-            selector_buffer += f'''{indent}#[derive(Deserialize, Serialize, Debug, PartialEq)]
-{indent}#[serde(deny_unknown_fields)]\n'''
+        name = get_rust_object_name(selector["name"])
+        struct_name = f"{name}{suffix}Configuration"
+        indent = " " * 4
+        if not "skip-serde" in selector or not selector["skip-serde"]:
+            selector_buffer += f"""{indent}#[derive(Deserialize, Serialize, Debug, PartialEq)]
+{indent}#[serde(deny_unknown_fields)]\n"""
         else:
-            selector_buffer += f'{indent}#[derive(Default)]\n'
+            selector_buffer += f"{indent}#[derive(Default)]\n"
 
-        selector_buffer += f'{indent}struct {struct_name} {{\n'
+        selector_buffer += f"{indent}struct {struct_name} {{\n"
 
-        indent = ' ' * 8
-        if not 'skip-serde' in selector or not selector['skip-serde']:
+        indent = " " * 8
+        if not "skip-serde" in selector or not selector["skip-serde"]:
             selector_buffer += f'{indent}#[serde(default, skip_serializing_if = "crate::is_default")]\n'
-        selector_buffer += f'{indent}name: String,\n'
+        selector_buffer += f"{indent}name: String,\n"
 
-        selector_buffer += get_rust_struct_fields_from_definition(struct_name, selector, default_functions, indent)
+        selector_buffer += get_rust_struct_fields_from_definition(
+            struct_name, selector, default_functions, indent
+        )
 
-        selector_buffer += '    }\n\n'
+        selector_buffer += "    }\n\n"
 
     output.write(selector_buffer)
 
+
 def generate_cpp_action_headers(def_dir, cxx_dest_dir):
     cpp_action_headers_fp = get_temporary_file_for_generated_code(cxx_dest_dir)
-    header_buffer = ''
+    header_buffer = ""
 
     # query actions
     actions_definitions = get_actions_definitions(def_dir, False)
-    suffix = 'Action'
+    suffix = "Action"
     for action in actions_definitions:
-        name = get_rust_object_name(action['name'])
-        struct_name = f'{name}{suffix}Configuration'
-        header_buffer += f'struct {struct_name};\n'
-        header_buffer += f'std::shared_ptr<DNS{suffix}Wrapper> get{name}{suffix}(const {struct_name}& config);\n'
+        name = get_rust_object_name(action["name"])
+        struct_name = f"{name}{suffix}Configuration"
+        header_buffer += f"struct {struct_name};\n"
+        header_buffer += f"std::shared_ptr<DNS{suffix}Wrapper> get{name}{suffix}(const {struct_name}& config);\n"
 
     # response actions
     actions_definitions = get_actions_definitions(def_dir, True)
-    suffix = 'ResponseAction'
+    suffix = "ResponseAction"
     for action in actions_definitions:
-        name = get_rust_object_name(action['name'])
-        struct_name = f'{name}{suffix}Configuration'
-        header_buffer += f'struct {struct_name};\n'
-        header_buffer += f'std::shared_ptr<DNS{suffix}Wrapper> get{name}{suffix}(const {struct_name}& config);\n'
+        name = get_rust_object_name(action["name"])
+        struct_name = f"{name}{suffix}Configuration"
+        header_buffer += f"struct {struct_name};\n"
+        header_buffer += f"std::shared_ptr<DNS{suffix}Wrapper> get{name}{suffix}(const {struct_name}& config);\n"
 
     cpp_action_headers_fp.write(header_buffer)
-    os.rename(cpp_action_headers_fp.name, f'{cxx_dest_dir}/dnsdist-rust-bridge-actions-generated.hh')
+    os.rename(
+        cpp_action_headers_fp.name,
+        f"{cxx_dest_dir}/dnsdist-rust-bridge-actions-generated.hh",
+    )
+
 
 def generate_cpp_selector_headers(def_dir, cxx_dest_dir):
     cpp_selector_headers_fp = get_temporary_file_for_generated_code(cxx_dest_dir)
-    header_buffer = ''
+    header_buffer = ""
 
     selectors_definitions = get_selectors_definitions(def_dir)
-    suffix = 'Selector'
+    suffix = "Selector"
     for selector in selectors_definitions:
-        name = get_rust_object_name(selector['name'])
-        struct_name = f'{name}{suffix}Configuration'
-        header_buffer += f'struct {struct_name};\n'
-        header_buffer += f'std::shared_ptr<DNS{suffix}> get{name}{suffix}(const {struct_name}& config);\n'
+        name = get_rust_object_name(selector["name"])
+        struct_name = f"{name}{suffix}Configuration"
+        header_buffer += f"struct {struct_name};\n"
+        header_buffer += f"std::shared_ptr<DNS{suffix}> get{name}{suffix}(const {struct_name}& config);\n"
     cpp_selector_headers_fp.write(header_buffer)
-    os.rename(cpp_selector_headers_fp.name, f'{cxx_dest_dir}/dnsdist-rust-bridge-selectors-generated.hh')
+    os.rename(
+        cpp_selector_headers_fp.name,
+        f"{cxx_dest_dir}/dnsdist-rust-bridge-selectors-generated.hh",
+    )
+
 
 def get_cpp_parameters(struct_name, parameters, skip_name):
-    output = ''
+    output = ""
     for parameter in parameters:
-        name = parameter['name']
-        ptype = parameter['type']
-        if name == 'name' and skip_name:
+        name = parameter["name"]
+        ptype = parameter["type"]
+        if name == "name" and skip_name:
             continue
         pname = get_rust_field_name(name)
         if len(output) > 0:
-            output += ', '
-        field = f'{struct_name}.{pname}'
-        if ptype == 'PacketBuffer':
-            field = f'PacketBuffer({field}.data(), {field}.data() + {field}.size())'
-        elif ptype == 'DNSName':
-            field = f'DNSName(std::string({field}))'
-        elif ptype == 'ComboAddress':
-            field = f'ComboAddress(std::string({field}))'
-        elif ptype == 'String':
-            field = f'std::string({field})'
-        elif ptype == 'ResponseConfig':
-            field = f'convertResponseConfig({field})'
-        elif ptype == 'Vec<SVCRecordParameters>':
-            field = f'convertSVCRecordParameters({field})'
-        elif ptype == 'SOAParams':
-            field = f'convertSOAParams({field})'
-        elif ptype == 'RCode':
+            output += ", "
+        field = f"{struct_name}.{pname}"
+        if ptype == "PacketBuffer":
+            field = f"PacketBuffer({field}.data(), {field}.data() + {field}.size())"
+        elif ptype == "DNSName":
+            field = f"DNSName(std::string({field}))"
+        elif ptype == "ComboAddress":
+            field = f"ComboAddress(std::string({field}))"
+        elif ptype == "String":
+            field = f"std::string({field})"
+        elif ptype == "ResponseConfig":
+            field = f"convertResponseConfig({field})"
+        elif ptype == "Vec<SVCRecordParameters>":
+            field = f"convertSVCRecordParameters({field})"
+        elif ptype == "SOAParams":
+            field = f"convertSOAParams({field})"
+        elif ptype == "RCode":
             field = f'dnsdist::configuration::yaml::strToRCode("{struct_name}", "{name}", {field})'
-        elif ptype == 'Opcode':
+        elif ptype == "Opcode":
             field = f'dnsdist::configuration::yaml::strToOpcode("{struct_name}", "{name}", {field})'
         output += field
     return output
 
+
 def generate_cpp_action_wrappers(def_dir, cxx_dest_dir):
     cpp_action_wrappers_fp = get_temporary_file_for_generated_code(cxx_dest_dir)
-    wrappers_buffer = ''
+    wrappers_buffer = ""
 
     # query actions
     actions_definitions = get_actions_definitions(def_dir, False)
-    suffix = 'Action'
+    suffix = "Action"
     for action in actions_definitions:
-        if 'skip-rust' in action and action['skip-rust']:
+        if "skip-rust" in action and action["skip-rust"]:
             continue
-        name = get_rust_object_name(action['name'])
-        struct_name = f'{name}{suffix}Configuration'
-        parameters = get_cpp_parameters('config', action['parameters'], True) if 'parameters' in action else ''
-        wrappers_buffer += f'''std::shared_ptr<DNS{suffix}Wrapper> get{name}{suffix}(const {struct_name}& config)
+        name = get_rust_object_name(action["name"])
+        struct_name = f"{name}{suffix}Configuration"
+        parameters = (
+            get_cpp_parameters("config", action["parameters"], True)
+            if "parameters" in action
+            else ""
+        )
+        wrappers_buffer += f"""std::shared_ptr<DNS{suffix}Wrapper> get{name}{suffix}(const {struct_name}& config)
 {{
   auto action = dnsdist::actions::get{name}{suffix}({parameters});
   return newDNSActionWrapper(std::move(action), config.name);
 }}
-'''
+"""
 
     # response actions
     actions_definitions = get_actions_definitions(def_dir, True)
-    suffix = 'ResponseAction'
+    suffix = "ResponseAction"
     for action in actions_definitions:
-        if 'skip-rust' in action and action['skip-rust']:
+        if "skip-rust" in action and action["skip-rust"]:
             continue
-        name = get_rust_object_name(action['name'])
-        struct_name = f'{name}{suffix}Configuration'
-        parameters = get_cpp_parameters('config', action['parameters'], True) if 'parameters' in action else ''
-        wrappers_buffer += f'''std::shared_ptr<DNS{suffix}Wrapper> get{name}{suffix}(const {struct_name}& config)
+        name = get_rust_object_name(action["name"])
+        struct_name = f"{name}{suffix}Configuration"
+        parameters = (
+            get_cpp_parameters("config", action["parameters"], True)
+            if "parameters" in action
+            else ""
+        )
+        wrappers_buffer += f"""std::shared_ptr<DNS{suffix}Wrapper> get{name}{suffix}(const {struct_name}& config)
 {{
   auto action = dnsdist::actions::get{name}{suffix}({parameters});
   return newDNSResponseActionWrapper(std::move(action), config.name);
 }}
-'''
+"""
 
     cpp_action_wrappers_fp.write(wrappers_buffer)
-    os.rename(cpp_action_wrappers_fp.name, f'{cxx_dest_dir}/dnsdist-rust-bridge-actions-generated-body.hh')
+    os.rename(
+        cpp_action_wrappers_fp.name,
+        f"{cxx_dest_dir}/dnsdist-rust-bridge-actions-generated-body.hh",
+    )
+
 
 def generate_cpp_selector_wrappers(def_dir, cxx_dest_dir):
     cpp_selector_wrappers_fp = get_temporary_file_for_generated_code(cxx_dest_dir)
-    wrappers_buffer = ''
+    wrappers_buffer = ""
 
     selectors_definitions = get_selectors_definitions(def_dir)
-    suffix = 'Selector'
+    suffix = "Selector"
     for selector in selectors_definitions:
-        if 'skip-rust' in selector and selector['skip-rust']:
+        if "skip-rust" in selector and selector["skip-rust"]:
             continue
-        name = get_rust_object_name(selector['name'])
-        struct_name = f'{name}{suffix}Configuration'
-        parameters = get_cpp_parameters('config', selector['parameters'], True) if 'parameters' in selector else ''
-        wrappers_buffer += f'''std::shared_ptr<DNS{suffix}> get{name}{suffix}(const {struct_name}& config)
+        name = get_rust_object_name(selector["name"])
+        struct_name = f"{name}{suffix}Configuration"
+        parameters = (
+            get_cpp_parameters("config", selector["parameters"], True)
+            if "parameters" in selector
+            else ""
+        )
+        wrappers_buffer += f"""std::shared_ptr<DNS{suffix}> get{name}{suffix}(const {struct_name}& config)
 {{
   auto selector = dnsdist::selectors::get{name}{suffix}({parameters});
   return newDNSSelector(std::move(selector), config.name);
 }}
-'''
+"""
 
     cpp_selector_wrappers_fp.write(wrappers_buffer)
-    os.rename(cpp_selector_wrappers_fp.name, f'{cxx_dest_dir}/dnsdist-rust-bridge-selectors-generated-body.hh')
+    os.rename(
+        cpp_selector_wrappers_fp.name,
+        f"{cxx_dest_dir}/dnsdist-rust-bridge-selectors-generated-body.hh",
+    )
+
 
 def generate_rust_actions_enum(output, def_dir, response):
-    suffix = 'ResponseAction' if response else 'Action'
+    suffix = "ResponseAction" if response else "Action"
     actions_definitions = get_actions_definitions(def_dir, response)
-    enum_buffer = f'''#[allow(clippy::upper_case_acronyms)]
+    enum_buffer = f"""#[allow(clippy::upper_case_acronyms)]
 #[derive(Default, Serialize, Deserialize, Debug, PartialEq)]
 #[serde(tag = "type")]
 enum {suffix} {{
     #[default]
     Default,
-'''
+"""
 
     for action in actions_definitions:
-        name = get_rust_object_name(action['name'])
-        struct_name = f'{name}{suffix}Configuration'
-        if struct_name in ['ContinueActionConfiguration']:
+        name = get_rust_object_name(action["name"])
+        struct_name = f"{name}{suffix}Configuration"
+        if struct_name in ["ContinueActionConfiguration"]:
             # special version for Serde
-            enum_buffer += f'    {name}({struct_name}Serde),\n'
+            enum_buffer += f"    {name}({struct_name}Serde),\n"
         else:
-            enum_buffer += f'    {name}(dnsdistsettings::{struct_name}),\n'
+            enum_buffer += f"    {name}(dnsdistsettings::{struct_name}),\n"
 
-    enum_buffer += '}\n\n'
+    enum_buffer += "}\n\n"
 
     output.write(enum_buffer)
 
+
 def generate_rust_selectors_enum(output, def_dir):
-    suffix = 'Selector'
+    suffix = "Selector"
     selectors_definitions = get_selectors_definitions(def_dir)
-    enum_buffer = f'''#[allow(clippy::upper_case_acronyms)]
+    enum_buffer = f"""#[allow(clippy::upper_case_acronyms)]
 #[derive(Default, Serialize, Deserialize, Debug, PartialEq)]
 #[serde(tag = "type")]
 enum {suffix} {{
     #[default]
     Default,
-'''
+"""
 
     for selector in selectors_definitions:
-        name = get_rust_object_name(selector['name'])
-        struct_name = f'{name}{suffix}Configuration'
-        if struct_name in ['AndSelectorConfiguration', 'OrSelectorConfiguration', 'NotSelectorConfiguration']:
+        name = get_rust_object_name(selector["name"])
+        struct_name = f"{name}{suffix}Configuration"
+        if struct_name in [
+            "AndSelectorConfiguration",
+            "OrSelectorConfiguration",
+            "NotSelectorConfiguration",
+        ]:
             # special version for Serde
-            enum_buffer += f'    {name}({struct_name}Serde),\n'
+            enum_buffer += f"    {name}({struct_name}Serde),\n"
         else:
-            enum_buffer += f'    {name}(dnsdistsettings::{struct_name}),\n'
+            enum_buffer += f"    {name}(dnsdistsettings::{struct_name}),\n"
 
-    enum_buffer += '}\n\n'
+    enum_buffer += "}\n\n"
 
     output.write(enum_buffer)
 
+
 def get_actions_definitions(def_dir, response):
-    def_file = f'{def_dir}/dnsdist-response-actions-definitions.yml' if response else f'{def_dir}/dnsdist-actions-definitions.yml'
+    def_file = (
+        f"{def_dir}/dnsdist-response-actions-definitions.yml"
+        if response
+        else f"{def_dir}/dnsdist-actions-definitions.yml"
+    )
     return get_definitions_from_file(def_file)
 
+
 def get_selectors_definitions(def_dir):
-    def_file = f'{def_dir}/dnsdist-selectors-definitions.yml'
+    def_file = f"{def_dir}/dnsdist-selectors-definitions.yml"
     return get_definitions_from_file(def_file)
 
+
 def generate_cpp_action_selector_functions_callable_from_rust(output, def_dir):
-    output_buffer = '''
+    output_buffer = """
     /*
      * Functions callable from Rust (actions and selectors)
      */
     unsafe extern "C++" {
-'''
+"""
     # first query actions
     actions_definitions = get_actions_definitions(def_dir, False)
-    suffix = 'Action'
+    suffix = "Action"
     for action in actions_definitions:
-        name = get_rust_object_name(action['name'])
-        output_buffer += f'        fn get{name}{suffix}(config: &{name}{suffix}Configuration) -> Result<SharedPtr<DNS{suffix}Wrapper>>;\n'
+        name = get_rust_object_name(action["name"])
+        output_buffer += f"        fn get{name}{suffix}(config: &{name}{suffix}Configuration) -> Result<SharedPtr<DNS{suffix}Wrapper>>;\n"
 
     # then response actions
     actions_definitions = get_actions_definitions(def_dir, True)
-    suffix = 'ResponseAction'
+    suffix = "ResponseAction"
     for action in actions_definitions:
-        name = get_rust_object_name(action['name'])
-        output_buffer += f'        fn get{name}{suffix}(config: &{name}{suffix}Configuration) -> Result<SharedPtr<DNS{suffix}Wrapper>>;\n'
+        name = get_rust_object_name(action["name"])
+        output_buffer += f"        fn get{name}{suffix}(config: &{name}{suffix}Configuration) -> Result<SharedPtr<DNS{suffix}Wrapper>>;\n"
 
     # then selectors
     selectors_definitions = get_selectors_definitions(def_dir)
-    suffix = 'Selector'
+    suffix = "Selector"
     for selector in selectors_definitions:
-        name = get_rust_object_name(selector['name'])
-        output_buffer += f'        fn get{name}{suffix}(config: &{name}{suffix}Configuration) -> Result<SharedPtr<DNS{suffix}>>;\n'
+        name = get_rust_object_name(selector["name"])
+        output_buffer += f"        fn get{name}{suffix}(config: &{name}{suffix}Configuration) -> Result<SharedPtr<DNS{suffix}>>;\n"
 
-    output_buffer += '    }\n'
+    output_buffer += "    }\n"
     output.write(output_buffer)
 
+
 def generate_rust_action_to_config(output, def_dir, response):
-    suffix = 'ResponseAction' if response else 'Action'
+    suffix = "ResponseAction" if response else "Action"
     actions_definitions = get_actions_definitions(def_dir, response)
-    function_name = 'get_one_action_from_serde' if not response else 'get_one_response_action_from_serde'
-    enum_buffer = f'''fn {function_name}(action: &{suffix}) -> Result<dnsdistsettings::SharedDNS{suffix}, cxx::Exception> {{
+    function_name = (
+        "get_one_action_from_serde"
+        if not response
+        else "get_one_response_action_from_serde"
+    )
+    enum_buffer = f"""fn {function_name}(action: &{suffix}) -> Result<dnsdistsettings::SharedDNS{suffix}, cxx::Exception> {{
     match action {{
         {suffix}::Default => {{}}
-'''
+"""
 
     for action in actions_definitions:
-        name = get_rust_object_name(action['name'])
-        if name in ['Continue']:
-            enum_buffer += f'''        {suffix}::{name}(cont) => {{
+        name = get_rust_object_name(action["name"])
+        if name in ["Continue"]:
+            enum_buffer += f"""        {suffix}::{name}(cont) => {{
              let config = dnsdistsettings::{name}{suffix}Configuration {{
                  action: get_one_action_from_serde(&cont.action)?,
                  ..Default::default()
@@ -673,36 +819,37 @@ def generate_rust_action_to_config(output, def_dir, response):
                  action: dnsdistsettings::get{name}{suffix}(&config)?,
              }});
         }}
-'''
+"""
         else:
-            enum_buffer += f'''        {suffix}::{name}(config) => {{
+            enum_buffer += f"""        {suffix}::{name}(config) => {{
                 return Ok(dnsdistsettings::SharedDNS{suffix} {{
                     action: dnsdistsettings::get{name}{suffix}(config)?,
                 }});
             }}
-'''
+"""
 
-    enum_buffer += '''    }
+    enum_buffer += """    }
     panic!("no action")
 }
-'''
+"""
 
     output.write(enum_buffer)
 
+
 def generate_rust_selector_to_config(output, def_dir):
-    suffix = 'Selector'
+    suffix = "Selector"
     selectors_definitions = get_selectors_definitions(def_dir)
-    function_name = 'get_one_selector_from_serde'
-    enum_buffer = f'''fn {function_name}(selector: &{suffix}) -> Result<dnsdistsettings::SharedDNS{suffix}, cxx::Exception> {{
+    function_name = "get_one_selector_from_serde"
+    enum_buffer = f"""fn {function_name}(selector: &{suffix}) -> Result<dnsdistsettings::SharedDNS{suffix}, cxx::Exception> {{
     match selector {{
         {suffix}::Default => {{}}
-'''
+"""
 
     for selector in selectors_definitions:
-        name = get_rust_object_name(selector['name'])
+        name = get_rust_object_name(selector["name"])
         var = name.lower()
-        if name in ['And', 'Or']:
-            enum_buffer += f'''        {suffix}::{name}({var}) => {{
+        if name in ["And", "Or"]:
+            enum_buffer += f"""        {suffix}::{name}({var}) => {{
              let mut config: dnsdistsettings::{name}{suffix}Configuration = Default::default();
              for sub_selector in &{var}.selectors {{
                  config.selectors.push(get_one_selector_from_serde(sub_selector)?)
@@ -711,9 +858,9 @@ def generate_rust_selector_to_config(output, def_dir):
                        selector: dnsdistsettings::get{name}{suffix}(&config)?
              }})
         }}
-'''
-        elif name in ['Not']:
-            enum_buffer += f'''        {suffix}::{name}({var}) => {{
+"""
+        elif name in ["Not"]:
+            enum_buffer += f"""        {suffix}::{name}({var}) => {{
              let mut config: dnsdistsettings::{name}{suffix}Configuration = Default::default();
              match get_one_selector_from_serde(&{var}.selector) {{
                  Ok(sel) => config.selector = sel,
@@ -726,9 +873,9 @@ def generate_rust_selector_to_config(output, def_dir):
                  Err(e) => return Err(e),
              }}
         }}
-'''
+"""
         else:
-            enum_buffer += f'''        {suffix}::{name}({var}) => {{
+            enum_buffer += f"""        {suffix}::{name}({var}) => {{
             match dnsdistsettings::get{name}{suffix}({var}) {{
                 Ok(sel) => return Ok(dnsdistsettings::SharedDNS{suffix} {{
                                   selector: sel,
@@ -736,35 +883,61 @@ def generate_rust_selector_to_config(output, def_dir):
                 Err(e) => return Err(e),
             }}
         }}
-'''
+"""
 
-    enum_buffer += '''    }
+    enum_buffer += """    }
     panic!("No selector")
 }
-'''
+"""
 
     output.write(enum_buffer)
 
-def handle_structures(generated_fp, definitions, default_functions, validation_functions):
+
+def handle_structures(
+    generated_fp, definitions, default_functions, validation_functions
+):
     for definition_name, keys in definitions.items():
-        generated_fp.write(get_rust_struct_from_definition(definition_name, keys, default_functions) + '\n')
-        if definition_name not in ['global', 'proto_buf_meta', 'proxy_protocol_value', 'query_rule', 'response_rule']:
-            validation_functions.append(get_struct_validation_function_from_definition(definition_name, keys['parameters'] if 'parameters' in keys else []))
+        generated_fp.write(
+            get_rust_struct_from_definition(definition_name, keys, default_functions)
+            + "\n"
+        )
+        if definition_name not in [
+            "global",
+            "proto_buf_meta",
+            "proxy_protocol_value",
+            "query_rule",
+            "response_rule",
+        ]:
+            validation_functions.append(
+                get_struct_validation_function_from_definition(
+                    definition_name, keys["parameters"] if "parameters" in keys else []
+                )
+            )
+
 
 def get_temporary_file_for_generated_code(directory):
-    generated_fp = tempfile.NamedTemporaryFile(mode='w+t', encoding='utf-8', dir=directory, delete=False)
-    generated_fp.write('// !! This file has been generated by dnsdist-settings-generator.py, do not edit by hand!!\n')
+    generated_fp = tempfile.NamedTemporaryFile(
+        mode="w+t", encoding="utf-8", dir=directory, delete=False
+    )
+    generated_fp.write(
+        "// !! This file has been generated by dnsdist-settings-generator.py, do not edit by hand!!\n"
+    )
     return generated_fp
 
+
 def main():
     if len(sys.argv) != 4:
-        print(f'Usage: {sys.argv[0]} <path/to/definitions/files> <rust/output/dir> <cxx/build/root/dir>')
+        print(
+            f"Usage: {sys.argv[0]} <path/to/definitions/files> <rust/output/dir> <cxx/build/root/dir>"
+        )
         sys.exit(1)
 
     definitions_dir = sys.argv[1]
     rust_dir = sys.argv[2]
     cxx_build_dir = sys.argv[3]
-    definitions = get_definitions_from_file(definitions_dir + '/dnsdist-settings-definitions.yml')
+    definitions = get_definitions_from_file(
+        definitions_dir + "/dnsdist-settings-definitions.yml"
+    )
     default_functions = []
     validation_functions = []
 
@@ -773,25 +946,40 @@ def main():
     generate_cpp_selector_headers(definitions_dir, cxx_build_dir)
     generate_cpp_selector_wrappers(definitions_dir, cxx_build_dir)
 
-    generated_fp = get_temporary_file_for_generated_code(f'{rust_dir}/rust/src/')
-    include_file(generated_fp, f'{rust_dir}/rust-pre-in.rs')
+    generated_fp = get_temporary_file_for_generated_code(f"{rust_dir}/rust/src/")
+    include_file(generated_fp, f"{rust_dir}/rust-pre-in.rs")
 
     generate_actions_config(generated_fp, definitions_dir, False, default_functions)
     generate_actions_config(generated_fp, definitions_dir, True, default_functions)
     generate_selectors_config(generated_fp, definitions_dir, default_functions)
 
-    handle_structures(generated_fp, definitions, default_functions, validation_functions)
+    handle_structures(
+        generated_fp, definitions, default_functions, validation_functions
+    )
 
-    generate_cpp_action_selector_functions_callable_from_rust(generated_fp, definitions_dir)
+    generate_cpp_action_selector_functions_callable_from_rust(
+        generated_fp, definitions_dir
+    )
 
-    include_file(generated_fp, f'{rust_dir}/rust-middle-in.rs')
+    include_file(generated_fp, f"{rust_dir}/rust-middle-in.rs")
     # we are now outside of the dnsdistsettings namespace
 
     # generate the special global configuration Serde structure
     for definition_name, keys in definitions.items():
-        if definition_name == 'global':
-            generated_fp.write(get_rust_struct_from_definition(definition_name, keys, default_functions, special_serde_object=True) + '\n')
-            validation_functions.append(get_struct_validation_function_from_definition(definition_name, keys['parameters'] if 'parameters' in keys else [], True))
+        if definition_name == "global":
+            generated_fp.write(
+                get_rust_struct_from_definition(
+                    definition_name, keys, default_functions, special_serde_object=True
+                )
+                + "\n"
+            )
+            validation_functions.append(
+                get_struct_validation_function_from_definition(
+                    definition_name,
+                    keys["parameters"] if "parameters" in keys else [],
+                    True,
+                )
+            )
 
     generate_rust_actions_enum(generated_fp, definitions_dir, False)
     generate_rust_actions_enum(generated_fp, definitions_dir, True)
@@ -799,20 +987,21 @@ def main():
 
     # the generated functions for the default values and validation
     for function_def in default_functions:
-        generated_fp.write(function_def + '\n')
+        generated_fp.write(function_def + "\n")
 
     for function_def in validation_functions:
-        generated_fp.write(function_def + '\n')
+        generated_fp.write(function_def + "\n")
 
     generate_rust_action_to_config(generated_fp, definitions_dir, False)
     generate_rust_action_to_config(generated_fp, definitions_dir, True)
     generate_rust_selector_to_config(generated_fp, definitions_dir)
 
-    include_file(generated_fp, rust_dir + '/rust-post-in.rs')
+    include_file(generated_fp, rust_dir + "/rust-post-in.rs")
+
+    os.rename(generated_fp.name, rust_dir + "/rust/src/lib.rs")
 
-    os.rename(generated_fp.name, rust_dir + '/rust/src/lib.rs')
+    generate_flat_settings_for_cxx(definitions, rust_dir, f"{cxx_build_dir}")
 
-    generate_flat_settings_for_cxx(definitions, rust_dir, f'{cxx_build_dir}')
 
-if __name__ == '__main__':
+if __name__ == "__main__":
     main()
index 5681b403788e8d3ac719f018435fedd1be485c10..22d33199df34ea6ce0715b8f7679818eb3fa7700 100644 (file)
@@ -1,37 +1,44 @@
 #!/usr/bin/python3
 """Load settings definitions and generates the corresponding documentation."""
+
 import os
 from pathlib import Path
 import sys
 import tempfile
 import yaml
 
+
 def quote(arg):
     """Return a quoted string"""
     return '"' + arg + '"'
 
+
 def get_vector_sub_type(rust_type):
     return rust_type[4:-1]
 
+
 def is_vector_of(rust_type):
-    return rust_type.startswith('Vec<')
+    return rust_type.startswith("Vec<")
+
 
 def is_type_native(rust_type):
     if is_vector_of(rust_type):
         sub_type = get_vector_sub_type(rust_type)
         return is_type_native(sub_type)
-    return rust_type in ['bool', 'u8', 'u16', 'u32', 'u64', 'f64', 'String']
+    return rust_type in ["bool", "u8", "u16", "u32", "u64", "f64", "String"]
+
 
 def get_definitions_from_file(def_file):
-    with open(def_file, 'rt', encoding="utf-8") as fd:
+    with open(def_file, "rt", encoding="utf-8") as fd:
         definitions = yaml.safe_load(fd.read())
         return definitions
 
+
 def get_rust_object_name(name):
-    object_name = ''
+    object_name = ""
     capitalize = True
     for char in name:
-        if char in ['-', '_']:
+        if char in ["-", "_"]:
             capitalize = True
             continue
         if capitalize:
@@ -41,108 +48,122 @@ def get_rust_object_name(name):
 
     return object_name
 
+
 def get_objects(def_file):
     objects = {}
     definitions = get_definitions_from_file(def_file)
     for definition_name, keys in definitions.items():
-        object_name = get_rust_object_name(definition_name) + 'Configuration'
+        object_name = get_rust_object_name(definition_name) + "Configuration"
         objects[object_name] = keys
 
     return objects
 
+
 def rust_type_to_human_str(rust_type, entry_type, generate_ref=True):
     if is_vector_of(rust_type):
-        return 'Sequence of ' + rust_type_to_human_str(get_vector_sub_type(rust_type), entry_type, generate_ref)
-    if rust_type in ['u8', 'u16', 'u32', 'u64']:
-        return 'Unsigned integer'
-    if rust_type == 'f64':
-        return 'Double'
-    if rust_type == 'bool':
-        return 'Boolean'
-    if rust_type == 'String':
-        return 'String'
+        return "Sequence of " + rust_type_to_human_str(
+            get_vector_sub_type(rust_type), entry_type, generate_ref
+        )
+    if rust_type in ["u8", "u16", "u32", "u64"]:
+        return "Unsigned integer"
+    if rust_type == "f64":
+        return "Double"
+    if rust_type == "bool":
+        return "Boolean"
+    if rust_type == "String":
+        return "String"
     if generate_ref:
-        return f':ref:`{rust_type} <yaml-{entry_type}-{rust_type}>`'
-    return f'{rust_type}'
+        return f":ref:`{rust_type} <yaml-{entry_type}-{rust_type}>`"
+    return f"{rust_type}"
+
 
 def print_structure(parameters, entry_type):
-    output = ''
+    output = ""
     # list
     for parameter in parameters:
-        output += f'- **{parameter["name"]}**: '
-        ptype = parameter['type']
-        if 'rust-type' in parameter:
-            ptype = parameter['rust-type']
+        output += f"- **{parameter['name']}**: "
+        ptype = parameter["type"]
+        if "rust-type" in parameter:
+            ptype = parameter["rust-type"]
         human_type = rust_type_to_human_str(ptype, entry_type)
-        output += f'{human_type}'
+        output += f"{human_type}"
 
-        if 'default' in parameter:
-            default = parameter['default']
+        if "default" in parameter:
+            default = parameter["default"]
             if default is not True:
-                if default == '':
+                if default == "":
                     output += ' ``("")``'
                 else:
-                    output += f' ``({default})``'
+                    output += f" ``({default})``"
 
-        if 'description' in parameter:
-            description = parameter['description']
-            output += ' - ' + description
+        if "description" in parameter:
+            description = parameter["description"]
+            output += " - " + description
 
-        if 'supported-values' in parameter:
-            values = ', '.join(parameter['supported-values'])
-            output += '. Supported values are: ' + values
+        if "supported-values" in parameter:
+            values = ", ".join(parameter["supported-values"])
+            output += ". Supported values are: " + values
 
-        output += '\n'
+        output += "\n"
 
-    output += '\n'
+    output += "\n"
 
     return output
 
-def process_object(object_name, entries, entry_type, is_setting_struct=False, lua_equivalent=None):
-    output = f'.. _yaml-{entry_type}-{object_name}:\n\n'
 
-    output += f'{object_name}\n'
-    output += '-' * len(object_name) + '\n'
-    output += '\n'
+def process_object(
+    object_name, entries, entry_type, is_setting_struct=False, lua_equivalent=None
+):
+    output = f".. _yaml-{entry_type}-{object_name}:\n\n"
 
-    if 'version_added' in entries:
-        output += '  .. versionadded:: ' + entries['version_added'] + '\n'
-        output += '\n'
+    output += f"{object_name}\n"
+    output += "-" * len(object_name) + "\n"
+    output += "\n"
 
-    if 'changes' in entries:
-        for change in entries['changes']:
-            if not 'version' in change or not 'content' in change:
+    if "version_added" in entries:
+        output += "  .. versionadded:: " + entries["version_added"] + "\n"
+        output += "\n"
+
+    if "changes" in entries:
+        for change in entries["changes"]:
+            if not "version" in change or not "content" in change:
                 continue
-            version = change['version']
-            content = change['content']
-        output += f' .. versionchanged:: {version}\n'
-        output += f'   {content}\n'
-        output += '\n'
+            version = change["version"]
+            content = change["content"]
+        output += f" .. versionchanged:: {version}\n"
+        output += f"   {content}\n"
+        output += "\n"
 
-    if 'description' in entries:
-        description = entries['description']
-        output += description + '\n'
-        output += '\n'
+    if "description" in entries:
+        description = entries["description"]
+        output += description + "\n"
+        output += "\n"
 
     if lua_equivalent is not None:
-        output += f'Lua equivalent: :func:`{lua_equivalent}`\n\n'
+        output += f"Lua equivalent: :func:`{lua_equivalent}`\n\n"
 
-    if 'parameters' in entries:
+    if "parameters" in entries:
         if not is_setting_struct:
             output += "Parameters:\n\n"
-        parameters = entries['parameters']
+        parameters = entries["parameters"]
         output += print_structure(parameters, entry_type)
-        output += '\n'
+        output += "\n"
 
     return output
 
+
 def get_temporary_file_for_generated_content(directory):
-    generated_fp = tempfile.NamedTemporaryFile(mode='w+t', encoding='utf-8', dir=directory, delete=False)
-    generated_fp.write('.. THIS IS A GENERATED FILE. DO NOT EDIT. See dnsdist-settings-documentation-generator.py\n\n')
+    generated_fp = tempfile.NamedTemporaryFile(
+        mode="w+t", encoding="utf-8", dir=directory, delete=False
+    )
+    generated_fp.write(
+        ".. THIS IS A GENERATED FILE. DO NOT EDIT. See dnsdist-settings-documentation-generator.py\n\n"
+    )
     return generated_fp
 
+
 def process_settings(def_file):
-    output = '''.. raw:: latex
+    output = """.. raw:: latex
 
     \\setcounter{secnumdepth}{-1}
 
@@ -160,78 +181,97 @@ It is possible to access objects declared in the YAML configuration from the con
 
 A YAML configuration file contains several sections, that are described below.
 
-'''
+"""
 
     objects = get_objects(def_file)
     for object_name, entries in sorted(objects.items()):
-        if object_name == 'GlobalConfiguration':
-            output += process_object(object_name, entries, 'settings', True)
+        if object_name == "GlobalConfiguration":
+            output += process_object(object_name, entries, "settings", True)
             break
 
-    output += '\n'
+    output += "\n"
 
     for object_name, entries in sorted(objects.items()):
-        if object_name != 'GlobalConfiguration':
-            output += process_object(object_name, entries, 'settings', True, entries['lua-name'] if 'lua-name' in entries else None)
+        if object_name != "GlobalConfiguration":
+            output += process_object(
+                object_name,
+                entries,
+                "settings",
+                True,
+                entries["lua-name"] if "lua-name" in entries else None,
+            )
 
     return output
 
+
 def process_selectors_or_actions(def_file, entry_type):
-    title = f'YAML {entry_type} reference'
+    title = f"YAML {entry_type} reference"
     object_name = get_rust_object_name(entry_type)
-    output = f'''.. raw:: latex
+    output = f""".. raw:: latex
 
     \\setcounter{{secnumdepth}}{{-1}}
 
 .. _yaml-settings-{object_name}:
 
 {title}
-'''
-    output += len(title)*'=' + '\n\n'
+"""
+    output += len(title) * "=" + "\n\n"
     entries = get_definitions_from_file(def_file)
 
     suffix = object_name
-    for entry in sorted(entries, key=lambda d: d['name']):
-        object_name = get_rust_object_name(entry['name'])
-        lua_equivalent = object_name + ('Rule' if entry_type == 'selector' else suffix)
-        if 'no-lua-equivalent' in entry:
+    for entry in sorted(entries, key=lambda d: d["name"]):
+        object_name = get_rust_object_name(entry["name"])
+        lua_equivalent = object_name + ("Rule" if entry_type == "selector" else suffix)
+        if "no-lua-equivalent" in entry:
             lua_equivalent = None
-        output += process_object(object_name + suffix, entry, 'settings', lua_equivalent=lua_equivalent)
+        output += process_object(
+            object_name + suffix, entry, "settings", lua_equivalent=lua_equivalent
+        )
 
     return output
 
+
 def main():
     if len(sys.argv) != 2:
-        print(f'Usage: {sys.argv[0]} <path/to/source/dir>')
+        print(f"Usage: {sys.argv[0]} <path/to/source/dir>")
         sys.exit(1)
 
     source_dir = sys.argv[1]
-    docs_folder = f'{source_dir}/docs/'
+    docs_folder = f"{source_dir}/docs/"
     if not os.path.isdir(docs_folder):
-        print('Skipping settings documentation generation because the docs/ folder does not exist')
+        print(
+            "Skipping settings documentation generation because the docs/ folder does not exist"
+        )
         return
 
     generated_fp = get_temporary_file_for_generated_content(docs_folder)
-    output = process_settings(f'{source_dir}/dnsdist-settings-definitions.yml')
+    output = process_settings(f"{source_dir}/dnsdist-settings-definitions.yml")
     generated_fp.write(output)
-    os.rename(generated_fp.name, f'{docs_folder}/reference/yaml-settings.rst')
+    os.rename(generated_fp.name, f"{docs_folder}/reference/yaml-settings.rst")
 
     generated_fp = get_temporary_file_for_generated_content(docs_folder)
-    output = process_selectors_or_actions(f'{source_dir}/dnsdist-actions-definitions.yml', 'action')
+    output = process_selectors_or_actions(
+        f"{source_dir}/dnsdist-actions-definitions.yml", "action"
+    )
     generated_fp.write(output)
-    os.rename(generated_fp.name, f'{docs_folder}/reference/yaml-actions.rst')
+    os.rename(generated_fp.name, f"{docs_folder}/reference/yaml-actions.rst")
 
     generated_fp = get_temporary_file_for_generated_content(docs_folder)
-    output = process_selectors_or_actions(f'{source_dir}/dnsdist-response-actions-definitions.yml', 'response-action')
+    output = process_selectors_or_actions(
+        f"{source_dir}/dnsdist-response-actions-definitions.yml", "response-action"
+    )
     generated_fp.write(output)
-    os.rename(generated_fp.name, f'{docs_folder}/reference/yaml-response-actions.rst')
+    os.rename(generated_fp.name, f"{docs_folder}/reference/yaml-response-actions.rst")
 
     generated_fp = get_temporary_file_for_generated_content(docs_folder)
-    output = process_selectors_or_actions(f'{source_dir}/dnsdist-selectors-definitions.yml', 'selector')
+    output = process_selectors_or_actions(
+        f"{source_dir}/dnsdist-selectors-definitions.yml", "selector"
+    )
     generated_fp.write(output)
-    os.rename(generated_fp.name, f'{docs_folder}/reference/yaml-selectors.rst')
+    os.rename(generated_fp.name, f"{docs_folder}/reference/yaml-selectors.rst")
+
+    Path(".yaml-settings.stamp").touch()
 
-    Path('.yaml-settings.stamp').touch()
 
-if __name__ == '__main__':
+if __name__ == "__main__":
     main()
index 6f9f8904d54f7107dacf6598962b19269d93be28..5513716364bdd01cd10e59c166b6899eff7e8769 100644 (file)
 #include "dnsdist-systemd.hh"
 #include <cstdlib>
 
-bool running_in_service_mgr() {
+bool running_in_service_mgr()
+{
 #ifdef HAVE_SYSTEMD
-  char *c;
+  charc;
   c = getenv("NOTIFY_SOCKET"); // XXX Ideally we'd check for INVOCATION_ID (systemd.exec(5)), but that was introduced in systemd 232, and Debian Jessie has 215
   if (c != nullptr) {
     return true;
index 45861c9c17510fda6cf67218691be336cb8da8a3..26ebc4359e3252b58e6f39c08ba1eb2e92c9530d 100644 (file)
@@ -39,7 +39,7 @@ bool ConnectionToBackend::reconnect()
 {
   std::unique_ptr<TLSSession> tlsSession{nullptr};
   if (d_handler) {
-    DEBUGLOG("closing socket "<<d_handler->getDescriptor());
+    DEBUGLOG("closing socket " << d_handler->getDescriptor());
     if (d_handler->isTLS()) {
       if (d_handler->hasTLSSessionBeenResumed()) {
         ++d_ds->tlsResumptions;
@@ -70,12 +70,12 @@ bool ConnectionToBackend::reconnect()
   d_proxyProtocolPayloadSent = false;
 
   do {
-    DEBUGLOG("TCP connecting to downstream "<<d_ds->getNameWithAddr()<<" ("<<d_downstreamFailures<<")");
-    DEBUGLOG("Opening TCP connection to backend "<<d_ds->getNameWithAddr());
+    DEBUGLOG("TCP connecting to downstream " << d_ds->getNameWithAddr() << " (" << d_downstreamFailures << ")");
+    DEBUGLOG("Opening TCP connection to backend " << d_ds->getNameWithAddr());
     ++d_ds->tcpNewConnections;
     try {
       auto socket = Socket(d_ds->d_config.remote.sin4.sin_family, SOCK_STREAM, 0);
-      DEBUGLOG("result of socket() is "<<socket.getHandle());
+      DEBUGLOG("result of socket() is " << socket.getHandle());
 
       /* disable NAGLE, which does not play nicely with delayed ACKs.
          In theory we could be wasting up to 500 milliseconds waiting for
@@ -107,7 +107,7 @@ bool ConnectionToBackend::reconnect()
       socket.setNonBlocking();
 
       gettimeofday(&d_connectionStartTime, nullptr);
-      auto handler = std::make_unique<TCPIOHandler>(d_ds->d_config.d_tlsSubjectName, d_ds->d_config.d_tlsSubjectIsAddr, socket.releaseHandle(), timeval{0,0}, d_ds->d_tlsCtx);
+      auto handler = std::make_unique<TCPIOHandler>(d_ds->d_config.d_tlsSubjectName, d_ds->d_config.d_tlsSubjectIsAddr, socket.releaseHandle(), timeval{0, 0}, d_ds->d_tlsCtx);
       if (!tlsSession && d_ds->d_tlsCtx) {
         tlsSession = g_sessionCache.getSession(d_ds->getID(), d_connectionStartTime.tv_sec);
       }
@@ -129,8 +129,7 @@ bool ConnectionToBackend::reconnect()
         throw;
       }
     }
-  }
-  while (d_downstreamFailures < d_ds->d_config.d_retries);
+  } while (d_downstreamFailures < d_ds->d_config.d_retries);
 
   return false;
 }
@@ -229,7 +228,8 @@ static void editPayloadID(PacketBuffer& payload, uint16_t newId, size_t proxyPro
   memcpy(&payload.at(startOfHeaderOffset), &id, sizeof(id));
 }
 
-enum class ConnectionState : uint8_t {
+enum class ConnectionState : uint8_t
+{
   needProxy,
   proxySent
 };
@@ -282,7 +282,7 @@ IOState TCPConnectionToBackend::sendQuery(std::shared_ptr<TCPConnectionToBackend
 {
   auto closer = conn->d_currentQuery.d_query.d_idstate.getCloser(classnamePrefix + __func__);
   (void)now;
-  DEBUGLOG("sending query to backend "<<conn->getDS()->getNameWithAddr()<<" over FD "<<conn->d_handler->getDescriptor());
+  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());
 
@@ -299,7 +299,7 @@ IOState TCPConnectionToBackend::sendQuery(std::shared_ptr<TCPConnectionToBackend
   ++conn->d_queries;
   conn->d_currentPos = 0;
 
-  DEBUGLOG("adding a pending response for ID "<<conn->d_highestStreamID<<" and QNAME "<<conn->d_currentQuery.d_query.d_idstate.qname);
+  DEBUGLOG("adding a pending response for ID " << conn->d_highestStreamID << " and QNAME " << conn->d_currentQuery.d_query.d_idstate.qname);
   auto res = conn->d_pendingResponses.insert({conn->d_highestStreamID, std::move(conn->d_currentQuery)});
   /* if there was already a pending response with that ID, we messed up and we don't expect more
      than one response */
@@ -315,7 +315,7 @@ IOState TCPConnectionToBackend::sendQuery(std::shared_ptr<TCPConnectionToBackend
 
 void TCPConnectionToBackend::handleReconnectionAttempt(std::shared_ptr<TCPConnectionToBackend>& conn, const struct timeval& now, IOStateGuard& ioGuard, IOState& iostate, bool& reconnected, bool& connectionDied)
 {
-  DEBUGLOG("connection died, number of failures is "<<conn->d_downstreamFailures<<", retries is "<<conn->d_ds->d_config.d_retries);
+  DEBUGLOG("connection died, number of failures is " << conn->d_downstreamFailures << ", retries is " << conn->d_ds->d_config.d_retries);
 
   if (conn->d_downstreamFailures < conn->d_ds->d_config.d_retries) {
 
@@ -393,7 +393,6 @@ void TCPConnectionToBackend::handleReconnectionAttempt(std::shared_ptr<TCPConnec
   }
 }
 
-
 void TCPConnectionToBackend::handleIO(std::shared_ptr<TCPConnectionToBackend>& conn, const struct timeval& now)
 {
   if (conn->d_handler == nullptr) {
@@ -431,8 +430,7 @@ void TCPConnectionToBackend::handleIO(std::shared_ptr<TCPConnectionToBackend>& c
         }
       }
 
-      if (conn->d_state == State::waitingForResponseFromBackend ||
-          conn->d_state == State::readingResponseSizeFromBackend) {
+      if (conn->d_state == State::waitingForResponseFromBackend || conn->d_state == State::readingResponseSizeFromBackend) {
         DEBUGLOG("reading response size from backend");
         // then we need to allocate a new buffer (new because we might need to re-send the query if the
         // backend dies on us)
@@ -478,11 +476,7 @@ void TCPConnectionToBackend::handleIO(std::shared_ptr<TCPConnectionToBackend>& c
         }
       }
 
-      if (conn->d_state != State::idle &&
-          conn->d_state != State::sendingQueryToBackend &&
-          conn->d_state != State::waitingForResponseFromBackend &&
-          conn->d_state != State::readingResponseSizeFromBackend &&
-          conn->d_state != State::readingResponseFromBackend) {
+      if (conn->d_state != State::idle && conn->d_state != State::sendingQueryToBackend && conn->d_state != State::waitingForResponseFromBackend && conn->d_state != State::readingResponseSizeFromBackend && conn->d_state != State::readingResponseFromBackend) {
         VERBOSESLOG(infolog("Unexpected state %d in TCPConnectionToBackend::handleIO", static_cast<int>(conn->d_state)),
                     conn->getLogger()->info(Logr::Info, "Unexpected state in TCPConnectionToBackend::handleIO", "state", Logging::Loggable(static_cast<int>(conn->d_state))));
       }
@@ -536,8 +530,7 @@ void TCPConnectionToBackend::handleIO(std::shared_ptr<TCPConnectionToBackend>& c
         conn->d_ioState->update(iostate, handleIOCallback, conn, ttd);
       }
     }
-  }
-  while (reconnected || (iostate != IOState::Done && !conn->d_connectionDied && !conn->d_lastIOBlocked));
+  } while (reconnected || (iostate != IOState::Done && !conn->d_connectionDied && !conn->d_lastIOBlocked));
 
   ioGuard.release();
 }
@@ -564,7 +557,7 @@ void TCPConnectionToBackend::queueQuery(std::shared_ptr<TCPQuerySender>& sender,
   // if we are not already sending a query or in the middle of reading a response (so idle),
   // start sending the query
   if (d_state == State::idle || d_state == State::waitingForResponseFromBackend) {
-    DEBUGLOG("Sending new query to backend right away, with ID "<<d_highestStreamID);
+    DEBUGLOG("Sending new query to backend right away, with ID " << d_highestStreamID);
     d_state = State::sendingQueryToBackend;
     d_currentPos = 0;
 
@@ -580,7 +573,7 @@ void TCPConnectionToBackend::queueQuery(std::shared_ptr<TCPQuerySender>& sender,
     handleIO(shared, now);
   }
   else {
-    DEBUGLOG("Adding new query to the queue because we are in state "<<(int)d_state);
+    DEBUGLOG("Adding new query to the queue because we are in state " << (int)d_state);
     // store query in the list of queries to send
     d_pendingQueries.push_back(PendingRequest({sender, std::move(query)}));
   }
@@ -712,7 +705,7 @@ IOState TCPConnectionToBackend::handleResponse(std::shared_ptr<TCPConnectionToBa
 
   auto it = d_pendingResponses.find(queryId);
   if (it == d_pendingResponses.end()) {
-    DEBUGLOG("could not find any corresponding query for ID "<<queryId<<". This is likely a duplicated ID over the same TCP connection, giving up!");
+    DEBUGLOG("could not find any corresponding query for ID " << queryId << ". This is likely a duplicated ID over the same TCP connection, giving up!");
     notifyAllQueriesFailed(now, FailureReason::unexpectedQueryID);
     return IOState::Done;
   }
@@ -732,7 +725,7 @@ IOState TCPConnectionToBackend::handleResponse(std::shared_ptr<TCPConnectionToBa
     const auto& queryIDS = it->second.d_query.d_idstate;
     /* we don't move the whole IDS because we will need it for the responses to come */
     response.d_idstate = queryIDS.partialCloneForXFR();
-    DEBUGLOG("passing XFRresponse to client connection for "<<response.d_idstate.qname);
+    DEBUGLOG("passing XFRresponse to client connection for " << response.d_idstate.qname);
 
     it->second.d_query.d_xfrStarted = true;
     done = isXFRFinished(response, it->second.d_query);
@@ -790,7 +783,7 @@ IOState TCPConnectionToBackend::handleResponse(std::shared_ptr<TCPConnectionToBa
   // anything without checking first
   auto shared = conn;
   if (sender->active()) {
-    DEBUGLOG("passing response to client connection for "<<ids.qname);
+    DEBUGLOG("passing response to client connection for " << ids.qname);
     // make sure that we still exist after calling handleResponse()
     TCPResponse response(std::move(d_responseBuffer), std::move(ids), conn, conn->d_ds);
     sender->handleResponse(now, std::move(response));
index be223c8a6bbb1b38ec1886efe507ac404c0f4a8b..0831b3a403950b8eeb7b87eb857e187f3b21f367 100644 (file)
@@ -8,7 +8,8 @@
 class ConnectionToBackend : public std::enable_shared_from_this<ConnectionToBackend>
 {
 public:
-  ConnectionToBackend(const std::shared_ptr<DownstreamState>& ds, std::unique_ptr<FDMultiplexer>& mplexer, const struct timeval& now): d_connectionStartTime(now), d_lastDataReceivedTime(now), d_ds(ds), d_mplexer(mplexer), d_enableFastOpen(ds->d_config.tcpFastOpen)
+  ConnectionToBackend(const std::shared_ptr<DownstreamState>& ds, std::unique_ptr<FDMultiplexer>& mplexer, const struct timeval& now) :
+    d_connectionStartTime(now), d_lastDataReceivedTime(now), d_ds(ds), d_mplexer(mplexer), d_enableFastOpen(ds->d_config.tcpFastOpen)
   {
     reconnect();
   }
@@ -228,7 +229,8 @@ protected:
 class TCPConnectionToBackend : public ConnectionToBackend
 {
 public:
-  TCPConnectionToBackend(const std::shared_ptr<DownstreamState>& ds, std::unique_ptr<FDMultiplexer>& mplexer, const struct timeval& now, std::string&& /* proxyProtocolPayload*, unused but there to match the HTTP2 connections, so we can use the same templated connections manager class */): ConnectionToBackend(ds, mplexer, now), d_responseBuffer(512)
+  TCPConnectionToBackend(const std::shared_ptr<DownstreamState>& ds, std::unique_ptr<FDMultiplexer>& mplexer, const struct timeval& now, std::string&& /* proxyProtocolPayload*, unused but there to match the HTTP2 connections, so we can use the same templated connections manager class */) :
+    ConnectionToBackend(ds, mplexer, now), d_responseBuffer(512)
   {
   }
 
@@ -263,7 +265,7 @@ public:
   std::string toString() const override
   {
     ostringstream o;
-    o << "TCP connection to backend "<<(d_ds ? d_ds->getName() : "empty")<<" over FD "<<(d_handler ? std::to_string(d_handler->getDescriptor()) : "no socket")<<", state is "<<(int)d_state<<", io state is "<<(d_ioState ? d_ioState->getState() : "empty")<<", queries count is "<<d_queries<<", pending queries count is "<<d_pendingQueries.size()<<", "<<d_pendingResponses.size()<<" pending responses";
+    o << "TCP connection to backend " << (d_ds ? d_ds->getName() : "empty") << " over FD " << (d_handler ? std::to_string(d_handler->getDescriptor()) : "no socket") << ", state is " << (int)d_state << ", io state is " << (d_ioState ? d_ioState->getState() : "empty") << ", queries count is " << d_queries << ", pending queries count is " << d_pendingQueries.size() << ", " << d_pendingResponses.size() << " pending responses";
     return o.str();
   }
 
@@ -274,8 +276,18 @@ public:
 private:
   /* waitingForResponseFromBackend is a state where we have not yet started reading the size,
      so we can still switch to sending instead */
-  enum class State : uint8_t { idle, sendingQueryToBackend, waitingForResponseFromBackend, readingResponseSizeFromBackend, readingResponseFromBackend };
-  enum class FailureReason : uint8_t { /* too many attempts */ gaveUp, timeout, unexpectedQueryID };
+  enum class State : uint8_t
+  {
+    idle,
+    sendingQueryToBackend,
+    waitingForResponseFromBackend,
+    readingResponseSizeFromBackend,
+    readingResponseFromBackend
+  };
+  enum class FailureReason : uint8_t
+  { /* too many attempts */ gaveUp,
+    timeout,
+    unexpectedQueryID };
 
   static void handleIO(std::shared_ptr<TCPConnectionToBackend>& conn, const struct timeval& now);
   static void handleIOCallback(int fd, FDMultiplexer::funcparam_t& param);
index 1b0e1e9a318fe926df1a85c3a17685ae9c2e7a77..3b4fe67a1206026b591eda40a02f9f6e1fa6f505 100644 (file)
@@ -9,7 +9,7 @@ struct TCPCrossProtocolResponse;
 class TCPClientThreadData
 {
 public:
-  TCPClientThreadData():
+  TCPClientThreadData() :
     mplexer(std::unique_ptr<FDMultiplexer>(FDMultiplexer::getMultiplexerSilent()))
   {
   }
@@ -24,10 +24,25 @@ public:
 class IncomingTCPConnectionState : public TCPQuerySender, public std::enable_shared_from_this<IncomingTCPConnectionState>
 {
 public:
-  enum class QueryProcessingResult : uint8_t { Forwarded, TooSmall, InvalidHeaders, Dropped, SelfAnswered, NoBackend, Asynchronous };
-  enum class ProxyProtocolResult : uint8_t { Reading, Done, Error };
+  enum class QueryProcessingResult : uint8_t
+  {
+    Forwarded,
+    TooSmall,
+    InvalidHeaders,
+    Dropped,
+    SelfAnswered,
+    NoBackend,
+    Asynchronous
+  };
+  enum class ProxyProtocolResult : uint8_t
+  {
+    Reading,
+    Done,
+    Error
+  };
 
-  IncomingTCPConnectionState(ConnectionInfo&& ci, TCPClientThreadData& threadData, const struct timeval& now): d_buffer(sizeof(uint16_t)), d_ci(std::move(ci)), d_handler(d_ci.fd, timeval{dnsdist::configuration::getCurrentRuntimeConfiguration().d_tcpRecvTimeout,0}, d_ci.cs->tlsFrontend ? d_ci.cs->tlsFrontend->getContext() : (d_ci.cs->dohFrontend ? d_ci.cs->dohFrontend->d_tlsContext->getContext() : nullptr), now.tv_sec), d_connectionStartTime(now), d_ioState(make_unique<IOStateHandler>(*threadData.mplexer, d_ci.fd)), d_threadData(threadData), d_creatorThreadID(std::this_thread::get_id())
+  IncomingTCPConnectionState(ConnectionInfo&& ci, TCPClientThreadData& threadData, const struct timeval& now) :
+    d_buffer(sizeof(uint16_t)), d_ci(std::move(ci)), d_handler(d_ci.fd, timeval{dnsdist::configuration::getCurrentRuntimeConfiguration().d_tcpRecvTimeout, 0}, d_ci.cs->tlsFrontend ? d_ci.cs->tlsFrontend->getContext() : (d_ci.cs->dohFrontend ? d_ci.cs->dohFrontend->d_tlsContext->getContext() : nullptr), now.tv_sec), d_connectionStartTime(now), d_ioState(make_unique<IOStateHandler>(*threadData.mplexer, d_ci.fd)), d_threadData(threadData), d_creatorThreadID(std::this_thread::get_id())
   {
     d_origDest.reset();
     d_origDest.sin4.sin_family = d_ci.remote.sin4.sin_family;
@@ -118,7 +133,7 @@ public:
   std::string toString() const
   {
     ostringstream o;
-    o << "Incoming TCP connection from "<<d_ci.remote.toStringWithPort()<<" over FD "<<d_handler.getDescriptor()<<", state is "<<(int)d_state<<", io state is "<<(d_ioState ? d_ioState->getState() : "empty")<<", queries count is "<<d_queriesCount<<", current queries count is "<<d_currentQueriesCount<<", "<<d_queuedResponses.size()<<" queued responses, "<<d_ownedConnectionsToBackend.size()<<" owned connections to a backend";
+    o << "Incoming TCP connection from " << d_ci.remote.toStringWithPort() << " over FD " << d_handler.getDescriptor() << ", state is " << (int)d_state << ", io state is " << (d_ioState ? d_ioState->getState() : "empty") << ", queries count is " << d_queriesCount << ", current queries count is " << d_currentQueriesCount << ", " << d_queuedResponses.size() << " queued responses, " << d_ownedConnectionsToBackend.size() << " owned connections to a backend";
     return o.str();
   }
 
@@ -130,7 +145,17 @@ public:
 
   std::shared_ptr<const Logr::Logger> getLogger() const;
 
-  enum class State : uint8_t { starting, doingHandshake, readingProxyProtocolHeader, waitingForQuery, readingQuerySize, readingQuery, sendingResponse, idle /* in case of XFR, we stop processing queries */ };
+  enum class State : uint8_t
+  {
+    starting,
+    doingHandshake,
+    readingProxyProtocolHeader,
+    waitingForQuery,
+    readingQuerySize,
+    readingQuery,
+    sendingResponse,
+    idle /* in case of XFR, we stop processing queries */
+  };
 
   TCPResponse d_currentResponse;
   std::map<std::shared_ptr<DownstreamState>, std::deque<std::shared_ptr<TCPConnectionToBackend>>> d_ownedConnectionsToBackend;
index b1de3020f4b7c1cc324ac8afa4b37d29541d3bf5..0066bbf5b8f7502c2d80679b76814510dc873f34 100644 (file)
@@ -29,31 +29,37 @@ from pathlib import Path
 #
 # needs_sphinx = '1.0'
 
-sys.path.append(str(Path('.').resolve()))
+sys.path.append(str(Path(".").resolve()))
 
 # Add any Sphinx extension module names here, as strings. They can be
 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
 # ones.
-extensions = ['redjack.sphinx.lua', 'sphinxcontrib.httpdomain', 'sphinxjsondomain',
-              'sphinxcontrib.fulltoc', 'changelog', 'depfile']
-primary_domain = 'lua'
+extensions = [
+    "redjack.sphinx.lua",
+    "sphinxcontrib.httpdomain",
+    "sphinxjsondomain",
+    "sphinxcontrib.fulltoc",
+    "changelog",
+    "depfile",
+]
+primary_domain = "lua"
 
 # Add any paths that contain templates here, relative to this directory.
-templates_path = ['_templates']
+templates_path = ["_templates"]
 
 # The suffix(es) of source filenames.
 # You can specify multiple suffix as a list of string:
 #
 # source_suffix = ['.rst', '.md']
-source_suffix = '.rst'
+source_suffix = ".rst"
 
 # The master toctree document.
-master_doc = 'index_TOC'
+master_doc = "index_TOC"
 
 # General information about the project.
-project = 'dnsdist'
-copyright = 'PowerDNS.COM BV and its contributors'
-author = 'PowerDNS.COM BV and its contributors'
+project = "dnsdist"
+copyright = "PowerDNS.COM BV and its contributors"
+author = "PowerDNS.COM BV and its contributors"
 
 # The version info for the project you're documenting, acts as replacement for
 # |version| and |release|, also used in various other places throughout the
@@ -74,16 +80,21 @@ language = None
 # List of patterns, relative to source directory, that match files and
 # directories to ignore when looking for source files.
 # This patterns also effect to html_static_path and html_extra_path
-exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '.venv',
-                    'http-api/override.rst',
-                    'common/zonemetadata.rst',
-                    'common/endpoint-servers-config.rst',
-                    'common/secpoll.rst',
-                    'common/api/*.rst',
-                    'common/tarball-pgp-keys.rst']
+exclude_patterns = [
+    "_build",
+    "Thumbs.db",
+    ".DS_Store",
+    ".venv",
+    "http-api/override.rst",
+    "common/zonemetadata.rst",
+    "common/endpoint-servers-config.rst",
+    "common/secpoll.rst",
+    "common/api/*.rst",
+    "common/tarball-pgp-keys.rst",
+]
 
 # The name of the Pygments (syntax highlighting) style to use.
-pygments_style = 'sphinx'
+pygments_style = "sphinx"
 
 # If true, `todo` and `todoList` produce output, else they produce nothing.
 todo_include_todos = False
@@ -94,8 +105,22 @@ changelog_render_ticket = "https://github.com/PowerDNS/pdns/issues/%s"
 changelog_render_pullreq = "https://github.com/PowerDNS/pdns/pull/%s"
 changelog_render_changeset = "https://github.com/PowerDNS/pdns/commit/%s"
 
-changelog_sections = ['New Features', 'Improvements', 'Bug Fixes', 'Removals']
-changelog_inner_tag_sort = ['Security', 'DNS over QUIC', 'DNS over HTTP3', 'DNS over HTTPS', 'DNS over TLS', 'DNSCrypt', 'DNSTAP', 'Protobuf', 'Performance', 'Webserver', 'Metrics', 'Meson', 'YAML']
+changelog_sections = ["New Features", "Improvements", "Bug Fixes", "Removals"]
+changelog_inner_tag_sort = [
+    "Security",
+    "DNS over QUIC",
+    "DNS over HTTP3",
+    "DNS over HTTPS",
+    "DNS over TLS",
+    "DNSCrypt",
+    "DNSTAP",
+    "Protobuf",
+    "Performance",
+    "Webserver",
+    "Metrics",
+    "Meson",
+    "YAML",
+]
 
 changelog_hide_tags_in_entry = True
 
@@ -104,8 +129,8 @@ changelog_hide_tags_in_entry = True
 # The theme to use for HTML and HTML Help pages.  See the documentation for
 # a list of builtin themes.
 #
-html_theme_path = ['_templates']
-html_theme = 'pdns_html'
+html_theme_path = ["_templates"]
+html_theme = "pdns_html"
 
 # Theme options are theme-specific and customize the look and feel of a theme
 # further.  For a list of options available for each theme, see the
@@ -116,16 +141,18 @@ html_theme_options = {}
 # Add any paths that contain custom static files (such as style sheets) here,
 # relative to this directory. They are copied after the builtin static files,
 # so a file named "default.css" will overwrite the builtin "default.css".
-html_static_path = ['_static']
+html_static_path = ["_static"]
 
-html_favicon = '_static/favicon.ico'
+html_favicon = "_static/favicon.ico"
 
-html_sidebars = { '**': ['searchbox.html', 'relations.html', 'localtoc.html', 'sourcelink.html'] }
+html_sidebars = {
+    "**": ["searchbox.html", "relations.html", "localtoc.html", "sourcelink.html"]
+}
 
 # -- Options for HTMLHelp output ------------------------------------------
 
 # Output file base name for HTML help builder.
-htmlhelp_basename = 'dnsdistdoc'
+htmlhelp_basename = "dnsdistdoc"
 
 
 # -- Options for LaTeX output ---------------------------------------------
@@ -133,16 +160,13 @@ htmlhelp_basename = 'dnsdistdoc'
 latex_elements = {
     # The paper size ('letterpaper' or 'a4paper').
     #
-    'papersize': 'a4paper',
-
+    "papersize": "a4paper",
     # The font size ('10pt', '11pt' or '12pt').
     #
     # 'pointsize': '10pt',
-
     # Additional stuff for the LaTeX preamble.
     #
     # 'preamble': '',
-
     # Latex figure (float) alignment
     #
     # 'figure_align': 'htbp',
@@ -152,11 +176,10 @@ latex_elements = {
 # (source start file, target name, title,
 #  author, documentclass [howto, manual, or own class]).
 latex_documents = [
-    (master_doc, 'dnsdist.tex', 'dnsdist',
-     'PowerDNS.COM BV', 'manual'),
+    (master_doc, "dnsdist.tex", "dnsdist", "PowerDNS.COM BV", "manual"),
 ]
 
-latex_logo = '_static/powerdns-logo-trans.png'
+latex_logo = "_static/powerdns-logo-trans.png"
 
 
 # -- Options for manual page output ---------------------------------------
@@ -164,9 +187,13 @@ latex_logo = '_static/powerdns-logo-trans.png'
 # One entry per manual page. List of tuples
 # (source start file, name, description, authors, manual section).
 man_pages = [
-    ('manpages/dnsdist.1', 'dnsdist',
-     'A DNS and DoS aware, scriptable loadbalancer',
-     [author], 1)
+    (
+        "manpages/dnsdist.1",
+        "dnsdist",
+        "A DNS and DoS aware, scriptable loadbalancer",
+        [author],
+        1,
+    )
 ]
 
 
@@ -176,13 +203,18 @@ man_pages = [
 # (source start file, target name, title, author,
 #  dir menu entry, description, category)
 texinfo_documents = [
-    (master_doc, 'dnsdist', 'dnsdist',
-     author, 'dnsdist', 'One line description of project.',
-     'Miscellaneous'),
+    (
+        master_doc,
+        "dnsdist",
+        "dnsdist",
+        author,
+        "dnsdist",
+        "One line description of project.",
+        "Miscellaneous",
+    ),
 ]
 
 
-
 # -- Options for Epub output ----------------------------------------------
 
 # Bibliographic Dublin Core info.
@@ -201,7 +233,7 @@ epub_copyright = copyright
 # epub_uid = ''
 
 # A list of files that should not be packed into the epub file.
-epub_exclude_files = ['search.html']
+epub_exclude_files = ["search.html"]
 
-depfile = 'sphinx.d'
-depfile_stamp = 'sphinx.stamp'
+depfile = "sphinx.d"
+depfile_stamp = "sphinx.stamp"
index 33f46ed9c5526d58e0a8ed88628bd0d004c99314..0c174f33db3c09c8ef0023ab7549ea0a5d847eb3 100644 (file)
@@ -6,7 +6,7 @@
 
 #if 0
 #define DEBUGLOG_ENABLED
-#define DEBUGLOG(x) cerr<<x<<endl;
+#define DEBUGLOG(x) cerr << x << endl;
 #else
 #define DEBUGLOG(x)
 #endif
 class IOStateHandler
 {
 public:
-  IOStateHandler(FDMultiplexer& mplexer, const int fd): d_mplexer(mplexer), d_fd(fd)
+  IOStateHandler(FDMultiplexer& mplexer, const int fd) :
+    d_mplexer(mplexer), d_fd(fd)
   {
   }
 
-  IOStateHandler(FDMultiplexer& mplexer): d_mplexer(mplexer), d_fd(-1)
+  IOStateHandler(FDMultiplexer& mplexer) :
+    d_mplexer(mplexer), d_fd(-1)
   {
   }
 
@@ -74,45 +76,45 @@ public:
 
   void add(IOState iostate, FDMultiplexer::callbackfunc_t callback, FDMultiplexer::funcparam_t callbackData, std::optional<struct timeval> ttd)
   {
-    DEBUGLOG("in "<<__PRETTY_FUNCTION__<<" for fd "<<d_fd<<", last state was "<<getState()<<", adding "<<(int)iostate);
+    DEBUGLOG("in " << __PRETTY_FUNCTION__ << " for fd " << d_fd << ", last state was " << getState() << ", adding " << (int)iostate);
     if (iostate == IOState::NeedRead) {
       if (isWaitingForRead()) {
         if (ttd) {
           /* let's update the TTD ! */
-          d_mplexer.setReadTTD(d_fd, *ttd, /* we pass 0 here because we already have a TTD */0);
+          d_mplexer.setReadTTD(d_fd, *ttd, /* we pass 0 here because we already have a TTD */ 0);
         }
         return;
       }
 
       d_mplexer.addReadFD(d_fd, callback, callbackData, ttd ? &*ttd : nullptr);
-      DEBUGLOG(__PRETTY_FUNCTION__<<": add read FD "<<d_fd);
+      DEBUGLOG(__PRETTY_FUNCTION__ << ": add read FD " << d_fd);
       d_isWaitingForRead = true;
     }
     else if (iostate == IOState::NeedWrite) {
       if (isWaitingForWrite()) {
         if (ttd) {
           /* let's update the TTD ! */
-          d_mplexer.setWriteTTD(d_fd, *ttd, /* we pass 0 here because we already have a TTD */0);
+          d_mplexer.setWriteTTD(d_fd, *ttd, /* we pass 0 here because we already have a TTD */ 0);
         }
         return;
       }
 
       d_mplexer.addWriteFD(d_fd, callback, callbackData, ttd ? &*ttd : nullptr);
-      DEBUGLOG(__PRETTY_FUNCTION__<<": add write FD "<<d_fd);
+      DEBUGLOG(__PRETTY_FUNCTION__ << ": add write FD " << d_fd);
       d_isWaitingForWrite = true;
     }
   }
 
   void update(IOState iostate, FDMultiplexer::callbackfunc_t callback = FDMultiplexer::callbackfunc_t(), FDMultiplexer::funcparam_t callbackData = boost::any(), std::optional<struct timeval> ttd = std::nullopt)
   {
-    DEBUGLOG("in "<<__PRETTY_FUNCTION__<<" for fd "<<d_fd<<", last state was "<<getState()<<" , new state is "<<(int)iostate);
+    DEBUGLOG("in " << __PRETTY_FUNCTION__ << " for fd " << d_fd << ", last state was " << getState() << " , new state is " << (int)iostate);
     if (isWaitingForRead() && iostate == IOState::Done) {
-      DEBUGLOG(__PRETTY_FUNCTION__<<": remove read FD "<<d_fd);
+      DEBUGLOG(__PRETTY_FUNCTION__ << ": remove read FD " << d_fd);
       d_mplexer.removeReadFD(d_fd);
       d_isWaitingForRead = false;
     }
     if (isWaitingForWrite() && iostate == IOState::Done) {
-      DEBUGLOG(__PRETTY_FUNCTION__<<": remove write FD "<<d_fd);
+      DEBUGLOG(__PRETTY_FUNCTION__ << ": remove write FD " << d_fd);
       d_mplexer.removeWriteFD(d_fd);
       d_isWaitingForWrite = false;
     }
@@ -121,7 +123,7 @@ public:
       if (isWaitingForRead()) {
         if (ttd) {
           /* let's update the TTD ! */
-          d_mplexer.setReadTTD(d_fd, *ttd, /* we pass 0 here because we already have a TTD */0);
+          d_mplexer.setReadTTD(d_fd, *ttd, /* we pass 0 here because we already have a TTD */ 0);
         }
         return;
       }
@@ -129,11 +131,11 @@ public:
       if (isWaitingForWrite()) {
         d_isWaitingForWrite = false;
         d_mplexer.alterFDToRead(d_fd, std::move(callback), callbackData, ttd ? &*ttd : nullptr);
-        DEBUGLOG(__PRETTY_FUNCTION__<<": alter from write to read FD "<<d_fd);
+        DEBUGLOG(__PRETTY_FUNCTION__ << ": alter from write to read FD " << d_fd);
       }
       else {
         d_mplexer.addReadFD(d_fd, std::move(callback), callbackData, ttd ? &*ttd : nullptr);
-        DEBUGLOG(__PRETTY_FUNCTION__<<": add read FD "<<d_fd);
+        DEBUGLOG(__PRETTY_FUNCTION__ << ": add read FD " << d_fd);
       }
 
       d_isWaitingForRead = true;
@@ -142,7 +144,7 @@ public:
       if (isWaitingForWrite()) {
         if (ttd) {
           /* let's update the TTD ! */
-          d_mplexer.setWriteTTD(d_fd, *ttd, /* we pass 0 here because we already have a TTD */0);
+          d_mplexer.setWriteTTD(d_fd, *ttd, /* we pass 0 here because we already have a TTD */ 0);
         }
         return;
       }
@@ -150,17 +152,17 @@ public:
       if (isWaitingForRead()) {
         d_isWaitingForRead = false;
         d_mplexer.alterFDToWrite(d_fd, std::move(callback), callbackData, ttd ? &*ttd : nullptr);
-        DEBUGLOG(__PRETTY_FUNCTION__<<": alter from read to write FD "<<d_fd);
+        DEBUGLOG(__PRETTY_FUNCTION__ << ": alter from read to write FD " << d_fd);
       }
       else {
         d_mplexer.addWriteFD(d_fd, std::move(callback), callbackData, ttd ? &*ttd : nullptr);
-        DEBUGLOG(__PRETTY_FUNCTION__<<": add write FD "<<d_fd);
+        DEBUGLOG(__PRETTY_FUNCTION__ << ": add write FD " << d_fd);
       }
 
       d_isWaitingForWrite = true;
     }
     else if (iostate == IOState::Done) {
-      DEBUGLOG(__PRETTY_FUNCTION__<<": done");
+      DEBUGLOG(__PRETTY_FUNCTION__ << ": done");
     }
   }
 
@@ -176,7 +178,8 @@ class IOStateGuard
 public:
   /* this class is using RAII to make sure we don't forget to release an IOStateHandler
      from the IO multiplexer in case of exception / error handling */
-  IOStateGuard(std::unique_ptr<IOStateHandler>& handler): d_handler(handler), d_enabled(true)
+  IOStateGuard(std::unique_ptr<IOStateHandler>& handler) :
+    d_handler(handler), d_enabled(true)
   {
   }
 
index 7ebaf3114e967147f1d6403e737789dd0b8c6817..865c04d611cc6a7e5f61635fdad6dc527f1bef1c 100644 (file)
@@ -10,7 +10,8 @@
 
 BOOST_AUTO_TEST_SUITE(connectionmanagement_hh)
 
-BOOST_AUTO_TEST_CASE(test_ConnectionManagementEnabled) {
+BOOST_AUTO_TEST_CASE(test_ConnectionManagementEnabled)
+{
   size_t maxConns = 10;
 
   ConcurrentConnectionManager manager(maxConns);
@@ -61,7 +62,8 @@ BOOST_AUTO_TEST_CASE(test_ConnectionManagementEnabled) {
   BOOST_CHECK_EQUAL(manager.registerConnection(), false);
 }
 
-BOOST_AUTO_TEST_CASE(test_ConnectionManagementDisabledThenEnabled) {
+BOOST_AUTO_TEST_CASE(test_ConnectionManagementDisabledThenEnabled)
+{
   /* 0 means no limit */
   size_t maxConns = 0;
   ConcurrentConnectionManager manager(maxConns);
index 4bc0b02af9368066fbd7aa8af01f45ff3599cdd4..b8770115b662755eaf4de0ab0198ccbd7d98275c 100644 (file)
 
 BOOST_AUTO_TEST_SUITE(test_delaypipe_hh);
 
-BOOST_AUTO_TEST_CASE(test_object_pipe) {
+BOOST_AUTO_TEST_CASE(test_object_pipe)
+{
   ObjectPipe<int> op;
-  for(int n=0; n < 100; ++n)
+  for (int n = 0; n < 100; ++n)
     op.write(n);
 
   int i;
-  for(int n=0; n < 100; ++n) {
-    int res=op.readTimeout(&i, -1);
+  for (int n = 0; n < 100; ++n) {
+    int res = op.readTimeout(&i, -1);
     BOOST_CHECK_EQUAL(res, 1);
     BOOST_CHECK_EQUAL(n, i);
   }
@@ -28,7 +29,8 @@ BOOST_AUTO_TEST_CASE(test_object_pipe) {
 }
 
 std::atomic<int> done = 0;
-BOOST_AUTO_TEST_CASE(test_delay_pipe_small) {
+BOOST_AUTO_TEST_CASE(test_delay_pipe_small)
+{
   done = 0;
   struct Work
   {
@@ -40,13 +42,13 @@ BOOST_AUTO_TEST_CASE(test_delay_pipe_small) {
   };
   DelayPipe<Work> dp;
   int n;
-  for(n=0; n < 5; ++n) {
+  for (n = 0; n < 5; ++n) {
     Work w{n};
     dp.submit(w, 500);
   }
   BOOST_CHECK_EQUAL(done, 0);
 
-  for(; n < 10; ++n) {
+  for (; n < 10; ++n) {
     Work w{n};
     dp.submit(w, 1200);
   }
@@ -54,11 +56,11 @@ BOOST_AUTO_TEST_CASE(test_delay_pipe_small) {
   BOOST_CHECK_EQUAL(done, 5);
   sleep(1);
   BOOST_CHECK_EQUAL(done, n);
-
 }
 
-BOOST_AUTO_TEST_CASE(test_delay_pipe_big) {
-  done=0;
+BOOST_AUTO_TEST_CASE(test_delay_pipe_big)
+{
+  done = 0;
   struct Work
   {
     int i;
@@ -69,7 +71,7 @@ BOOST_AUTO_TEST_CASE(test_delay_pipe_big) {
   };
   DelayPipe<Work> dp;
   int n;
-  for(n=0; n < 1000000; ++n) {
+  for (n = 0; n < 1000000; ++n) {
     Work w{n};
     dp.submit(w, 100);
   }
index a79db4422e007ff205d82aa338ababef7c8a971a..12bb2c7fd0cbbeada1283e8f09087a6fd29ef8a2 100644 (file)
@@ -24,7 +24,7 @@ struct TestFixture
   TestFixture()
   {
     g_rings.reset();
-    Rings::RingsConfiguration config {
+    Rings::RingsConfiguration config{
       .capacity = 10000U,
       .numberOfShards = 10U,
     };
@@ -43,7 +43,7 @@ struct TestFixtureWithSampling
   TestFixtureWithSampling()
   {
     g_rings.reset();
-    Rings::RingsConfiguration config {
+    Rings::RingsConfiguration config{
       .capacity = 10000U,
       .numberOfShards = 10U,
       .samplingRate = s_samplingRate,
@@ -56,7 +56,8 @@ struct TestFixtureWithSampling
   }
 };
 
-BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesGroup_QueryRate, TestFixture) {
+BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesGroup_QueryRate, TestFixture)
+{
   dnsheader dnsHeader{};
   memset(&dnsHeader, 0, sizeof(dnsHeader));
   DNSName qname("rings.powerdns.com.");
@@ -195,7 +196,8 @@ BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesGroup_QueryRate, TestFixture) {
   }
 }
 
-BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesGroup_QueryRate_RangeV6, TestFixture) {
+BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesGroup_QueryRate_RangeV6, TestFixture)
+{
   /* Check that we correctly group IPv6 addresses from the same /64 subnet into the same
      dynamic block entry, if instructed to do so */
   dnsheader dnsHeader{};
@@ -298,7 +300,8 @@ BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesGroup_QueryRate_RangeV6, TestFixture)
   }
 }
 
-BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesGroup_QueryRate_V4Ports, TestFixture) {
+BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesGroup_QueryRate_V4Ports, TestFixture)
+{
   /* Check that we correctly split IPv4 addresses based on port ranges, when instructed to do so */
   dnsheader dnsHeader{};
   memset(&dnsHeader, 0, sizeof(dnsHeader));
@@ -428,11 +431,11 @@ BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesGroup_QueryRate_V4Ports, TestFixture)
 
     /* but not a different one */
     BOOST_CHECK(dnsdist::DynamicBlocks::getClientAddressDynamicRules().lookup(AddressAndPortRange(ComboAddress("192.0.2.1:16384"), 32, 16)) == nullptr);
-
   }
 }
 
-BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesGroup_QueryRate_responses, TestFixture) {
+BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesGroup_QueryRate_responses, TestFixture)
+{
   /* check that the responses are not accounted as queries when a
      rcode rate rule is defined (sounds very specific but actually happened) */
   dnsheader dnsHeader{};
@@ -452,7 +455,7 @@ BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesGroup_QueryRate_responses, TestFixture
 
   /* 100k entries, one shard */
   g_rings.reset();
-  Rings::RingsConfiguration config {
+  Rings::RingsConfiguration config{
     .capacity = 1000000U,
   };
   g_rings.init(config);
@@ -502,7 +505,8 @@ BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesGroup_QueryRate_responses, TestFixture
   }
 }
 
-BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesGroup_QTypeRate, TestFixture) {
+BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesGroup_QTypeRate, TestFixture)
+{
   dnsheader dnsHeader{};
   memset(&dnsHeader, 0, sizeof(dnsHeader));
   DNSName qname("rings.powerdns.com.");
@@ -590,10 +594,10 @@ BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesGroup_QTypeRate, TestFixture) {
     BOOST_CHECK_EQUAL(block.blocks, 0U);
     BOOST_CHECK_EQUAL(block.warning, false);
   }
-
 }
 
-BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesGroup_RCodeRate, TestFixture) {
+BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesGroup_RCodeRate, TestFixture)
+{
   dnsheader dnsHeader{};
   memset(&dnsHeader, 0, sizeof(dnsHeader));
   DNSName qname("rings.powerdns.com.");
@@ -686,10 +690,10 @@ BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesGroup_RCodeRate, TestFixture) {
     BOOST_CHECK_EQUAL(block.blocks, 0U);
     BOOST_CHECK_EQUAL(block.warning, false);
   }
-
 }
 
-BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesGroup_RCodeRate_With_Sampling, TestFixtureWithSampling) {
+BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesGroup_RCodeRate_With_Sampling, TestFixtureWithSampling)
+{
   dnsheader dnsHeader{};
   memset(&dnsHeader, 0, sizeof(dnsHeader));
   DNSName qname("rings.powerdns.com.");
@@ -782,10 +786,10 @@ BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesGroup_RCodeRate_With_Sampling, TestFix
     BOOST_CHECK_EQUAL(block.blocks, 0U);
     BOOST_CHECK_EQUAL(block.warning, false);
   }
-
 }
 
-BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesGroup_RCodeRatio, TestFixture) {
+BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesGroup_RCodeRatio, TestFixture)
+{
   dnsheader dnsHeader{};
   memset(&dnsHeader, 0, sizeof(dnsHeader));
   DNSName qname("rings.powerdns.com.");
@@ -907,7 +911,8 @@ BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesGroup_RCodeRatio, TestFixture) {
   }
 }
 
-BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesGroup_ResponseByteRate, TestFixture) {
+BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesGroup_ResponseByteRate, TestFixture)
+{
   dnsheader dnsHeader{};
   memset(&dnsHeader, 0, sizeof(dnsHeader));
   DNSName qname("rings.powerdns.com.");
@@ -983,7 +988,8 @@ BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesGroup_ResponseByteRate, TestFixture) {
   }
 }
 
-BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesGroup_CacheMissRatio, TestFixture) {
+BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesGroup_CacheMissRatio, TestFixture)
+{
   dnsheader dnsHeader{};
   memset(&dnsHeader, 0, sizeof(dnsHeader));
   DNSName qname("rings.powerdns.com.");
@@ -995,9 +1001,7 @@ BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesGroup_CacheMissRatio, TestFixture) {
   uint16_t size = 42;
   dnsdist::Protocol outgoingProtocol = dnsdist::Protocol::DoUDP;
   unsigned int responseTime = 100 * 1000; /* 100ms */
-  struct timespec now
-  {
-  };
+  struct timespec now{};
   gettime(&now);
   NetmaskTree<DynBlock, AddressAndPortRange> emptyNMG;
 
@@ -1108,7 +1112,8 @@ BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesGroup_CacheMissRatio, TestFixture) {
   }
 }
 
-BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesGroup_Warning, TestFixture) {
+BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesGroup_Warning, TestFixture)
+{
   dnsheader dnsHeader{};
   memset(&dnsHeader, 0, sizeof(dnsHeader));
   DNSName qname("rings.powerdns.com.");
@@ -1271,7 +1276,8 @@ BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesGroup_Warning, TestFixture) {
   }
 }
 
-BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesGroup_Ranges, TestFixture) {
+BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesGroup_Ranges, TestFixture)
+{
   dnsheader dnsHeader{};
   memset(&dnsHeader, 0, sizeof(dnsHeader));
   DNSName qname("rings.powerdns.com.");
@@ -1328,10 +1334,10 @@ BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesGroup_Ranges, TestFixture) {
     BOOST_CHECK_EQUAL(block.blocks, 0U);
     BOOST_CHECK_EQUAL(block.warning, false);
   }
-
 }
 
-BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesMetricsCache_GetTopN, TestFixture) {
+BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesMetricsCache_GetTopN, TestFixture)
+{
   dnsheader dnsHeader{};
   memset(&dnsHeader, 0, sizeof(dnsHeader));
   DNSName qname("rings.powerdns.com.");
@@ -1351,7 +1357,7 @@ BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesMetricsCache_GetTopN, TestFixture) {
 
   g_rings.reset();
   /* 10M entries, only one shard */
-  Rings::RingsConfiguration config {
+  Rings::RingsConfiguration config{
     .capacity = 10000000U,
   };
   g_rings.init(config);
@@ -1572,11 +1578,11 @@ BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesMetricsCache_GetTopN, TestFixture) {
     StopWatch sw;
     sw.start();
     dbrg.apply(now);
-    cerr<<"added 1000000 entries in "<<std::to_string(sw.udiff()/1024)<<"ms"<<endl;
+    cerr << "added 1000000 entries in " << std::to_string(sw.udiff() / 1024) << "ms" << endl;
 
     sw.start();
     auto top = DynBlockMaintenance::getTopSuffixes(20);
-    cerr<<"scanned 1000000 entries in "<<std::to_string(sw.udiff()/1024)<<"ms"<<endl;
+    cerr << "scanned 1000000 entries in " << std::to_string(sw.udiff() / 1024) << "ms" << endl;
     BOOST_CHECK_EQUAL(top.at(reason).size(), 20U);
     BOOST_CHECK_EQUAL(top.size(), 1U);
 
@@ -1584,7 +1590,7 @@ BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesMetricsCache_GetTopN, TestFixture) {
     expired.tv_sec += blockDuration + 1;
     sw.start();
     DynBlockMaintenance::purgeExpired(expired);
-    cerr<<"removed 1000000 entries in "<<std::to_string(sw.udiff()/1024)<<"ms"<<endl;
+    cerr << "removed 1000000 entries in " << std::to_string(sw.udiff() / 1024) << "ms" << endl;
     BOOST_CHECK_EQUAL(dnsdist::DynamicBlocks::getSuffixDynamicRules().getNodes().size(), 0U);
   }
 #endif
@@ -1620,24 +1626,25 @@ BOOST_FIXTURE_TEST_CASE(test_DynBlockRulesMetricsCache_GetTopN, TestFixture) {
     StopWatch sw;
     sw.start();
     dbrg.apply(now);
-    cerr<<"added "<<dnsdist::DynamicBlocks::getClientAddressDynamicRules().size()<<" entries in "<<std::to_string(sw.udiff()/1024)<<"ms"<<endl;
+    cerr << "added " << dnsdist::DynamicBlocks::getClientAddressDynamicRules().size() << " entries in " << std::to_string(sw.udiff() / 1024) << "ms" << endl;
     BOOST_CHECK_EQUAL(dnsdist::DynamicBlocks::getClientAddressDynamicRules().size(), 1000000U);
 
     sw.start();
     auto top = DynBlockMaintenance::getTopNetmasks(20);
-    cerr<<"scanned "<<dnsdist::DynamicBlocks::getClientAddressDynamicRules().size()<<" entries in "<<std::to_string(sw.udiff()/1024)<<"ms"<<endl;
+    cerr << "scanned " << dnsdist::DynamicBlocks::getClientAddressDynamicRules().size() << " entries in " << std::to_string(sw.udiff() / 1024) << "ms" << endl;
 
     struct timespec expired = now;
     expired.tv_sec += blockDuration + 1;
     sw.start();
     DynBlockMaintenance::purgeExpired(expired);
-    cerr<<"removed 1000000 entries in "<<std::to_string(sw.udiff()/1024)<<"ms"<<endl;
+    cerr << "removed 1000000 entries in " << std::to_string(sw.udiff() / 1024) << "ms" << endl;
     BOOST_CHECK_EQUAL(dnsdist::DynamicBlocks::getClientAddressDynamicRules().size(), 0U);
   }
 #endif
 }
 
-BOOST_AUTO_TEST_CASE(test_NetmaskTree) {
+BOOST_AUTO_TEST_CASE(test_NetmaskTree)
+{
   NetmaskTree<int, AddressAndPortRange> nmt;
   BOOST_CHECK_EQUAL(nmt.empty(), true);
   BOOST_CHECK_EQUAL(nmt.size(), 0U);
@@ -1698,7 +1705,8 @@ BOOST_AUTO_TEST_CASE(test_NetmaskTree) {
   BOOST_CHECK_EQUAL(nmt.lookup(ComboAddress("fe80::1"))->second, 2);
 }
 
-BOOST_AUTO_TEST_CASE(test_NetmaskTreePort) {
+BOOST_AUTO_TEST_CASE(test_NetmaskTreePort)
+{
   {
     /* exact port matching */
     NetmaskTree<int, AddressAndPortRange> nmt;
index 7177d67f4f3ec7de5f0cc2d9b77d1feb4df6bcf2..b459e6f2acebe4e923b290a1e64c439a99760986 100644 (file)
@@ -292,7 +292,6 @@ static void doKVSRangeChecks(std::unique_ptr<KeyValueStore>& kvs)
     check(notInRange1, false);
     check(notInRange2, false);
   }
-
 }
 #endif // defined(HAVE_LMDB)
 
@@ -301,7 +300,8 @@ static void doKVSRangeChecks(std::unique_ptr<KeyValueStore>& kvs)
 BOOST_AUTO_TEST_SUITE(dnsdistkvs_cc)
 
 #ifdef HAVE_LMDB
-BOOST_AUTO_TEST_CASE(test_LMDB) {
+BOOST_AUTO_TEST_CASE(test_LMDB)
+{
 
   InternalQueryState ids;
   ids.qname = DNSName("powerdns.com.");
@@ -386,7 +386,8 @@ BOOST_AUTO_TEST_CASE(test_LMDB) {
 #endif /* HAVE_LMDB */
 
 #ifdef HAVE_CDB
-BOOST_AUTO_TEST_CASE(test_CDB) {
+BOOST_AUTO_TEST_CASE(test_CDB)
+{
 
   InternalQueryState ids;
   ids.qname = DNSName("powerdns.com.");
index 58b0bf0f87affbde12f1cc2e3fc118036ed6f99f..0aae243643df0f72e14d066934877414a73b7ef4 100644 (file)
@@ -13,7 +13,8 @@
 
 BOOST_AUTO_TEST_SUITE(dnsdistrings_cc)
 
-template <class T> static bool checkQuery(const T& entry, const DNSName& qname, uint16_t qtype, uint16_t size, const timespec& now, const ComboAddress& requestor)
+template <class T>
+static bool checkQuery(const T& entry, const DNSName& qname, uint16_t qtype, uint16_t size, const timespec& now, const ComboAddress& requestor)
 {
   if (entry.name != qname) {
     return false;
@@ -50,7 +51,7 @@ static bool checkResponse(const Rings::Response& entry, const DNSName& qname, ui
 static void test_ring(size_t maxEntries, size_t numberOfShards, size_t nbLockTries)
 {
   Rings rings;
-  Rings::RingsConfiguration config {
+  Rings::RingsConfiguration config{
     .capacity = maxEntries,
     .numberOfShards = numberOfShards,
     .nbLockTries = nbLockTries,
@@ -138,8 +139,8 @@ static void test_ring(size_t maxEntries, size_t numberOfShards, size_t nbLockTri
   }
 }
 
-
-BOOST_AUTO_TEST_CASE(test_Rings_Simple) {
+BOOST_AUTO_TEST_CASE(test_Rings_Simple)
+{
 
   /* 5 entries over 1 shard */
   test_ring(5, 1, 0);
@@ -160,20 +161,20 @@ static void ringReaderThread(Rings& rings, std::atomic<bool>& done, size_t numbe
     for (const auto& shard : rings.d_shards) {
       {
         auto rl = shard->queryRing.lock();
-        for(const auto& c : *rl) {
+        for (const auto& c : *rl) {
           numberOfQueries++;
           // BOOST_CHECK* is slow as hell..
-          if(c.qtype != qtype) {
-            cerr<<"Invalid query QType!"<<endl;
+          if (c.qtype != qtype) {
+            cerr << "Invalid query QType!" << endl;
             return;
           }
         }
       }
       {
         auto rl = shard->respRing.lock();
-        for(const auto& c : *rl) {
-          if(c.qtype != qtype) {
-            cerr<<"Invalid response QType!"<<endl;
+        for (const auto& c : *rl) {
+          if (c.qtype != qtype) {
+            cerr << "Invalid response QType!" << endl;
             return;
           }
           numberOfResponses++;
@@ -201,7 +202,8 @@ static void ringWriterThread(Rings& rings, size_t numberOfEntries, const Rings::
   }
 }
 
-BOOST_AUTO_TEST_CASE(test_Rings_Threaded) {
+BOOST_AUTO_TEST_CASE(test_Rings_Threaded)
+{
   size_t numberOfEntries = 1000000;
   size_t numberOfShards = 50;
   size_t lockAttempts = 5;
@@ -228,7 +230,7 @@ BOOST_AUTO_TEST_CASE(test_Rings_Threaded) {
   dnsdist::Protocol outgoingProtocol = dnsdist::Protocol::DoUDP;
 
   Rings rings;
-  Rings::RingsConfiguration config {
+  Rings::RingsConfiguration config{
     .capacity = numberOfEntries,
     .numberOfShards = numberOfShards,
     .nbLockTries = lockAttempts,
@@ -310,13 +312,14 @@ BOOST_AUTO_TEST_CASE(test_Rings_Threaded) {
 #endif
 }
 
-BOOST_AUTO_TEST_CASE(test_Rings_Sampling) {
+BOOST_AUTO_TEST_CASE(test_Rings_Sampling)
+{
   const size_t numberOfEntries = 10000;
   const size_t numberOfShards = 50;
   const size_t samplingRate = 10;
 
   Rings rings;
-  const Rings::RingsConfiguration config {
+  const Rings::RingsConfiguration config{
     .capacity = numberOfEntries,
     .numberOfShards = numberOfShards,
     .samplingRate = samplingRate,
index 327c13e46132d020b7b8b6357569c8b05a2c22ad..c9ace2f5ea7d90266263bdfdaf785d5a1d46f617 100644 (file)
@@ -28,7 +28,7 @@ struct RuleParameter
 template <typename ParameterType>
 ParameterType getRequiredRuleParameter(const std::string& ruleName, std::vector<RuleParameter>& parameters, const std::string& parameterName)
 {
-  for (auto paramIt = parameters.begin(); paramIt != parameters.end(); ) {
+  for (auto paramIt = parameters.begin(); paramIt != parameters.end();) {
     if (paramIt->name != parameterName) {
       ++paramIt;
       continue;
@@ -46,7 +46,7 @@ ParameterType getOptionalRuleParameter(const std::string& ruleName, std::vector<
 {
   (void)ruleName;
 
-  for (auto paramIt = parameters.begin(); paramIt != parameters.end(); ) {
+  for (auto paramIt = parameters.begin(); paramIt != parameters.end();) {
     if (paramIt->name != parameterName) {
       ++paramIt;
       continue;
@@ -62,7 +62,7 @@ ParameterType getOptionalRuleParameter(const std::string& ruleName, std::vector<
 class TestMaxQPSIPRule : public DNSRule
 {
 public:
-  TestMaxQPSIPRule(const std::string& ruleName, std::vector<RuleParameter>& parameters):
+  TestMaxQPSIPRule(const std::string& ruleName, std::vector<RuleParameter>& parameters) :
     d_qps(getRequiredRuleParameter<unsigned int>(ruleName, parameters, "qps")),
     d_burst(getOptionalRuleParameter<unsigned int>(ruleName, parameters, "burst", d_qps)),
     d_ipv4trunc(getOptionalRuleParameter<unsigned int>(ruleName, parameters, "ipv4-truncation", 32))
@@ -79,6 +79,7 @@ public:
   {
     return "";
   }
+
 private:
   unsigned int d_qps;
   unsigned int d_burst;
@@ -109,7 +110,8 @@ static DNSQuestion getDQ(const DNSName* providedName = nullptr)
 
 BOOST_AUTO_TEST_SUITE(dnsdistluarules_cc)
 
-BOOST_AUTO_TEST_CASE(test_MaxQPSIPRule) {
+BOOST_AUTO_TEST_CASE(test_MaxQPSIPRule)
+{
   size_t maxQPS = 10;
   size_t maxBurst = maxQPS;
   unsigned int expiration = 300;
@@ -158,7 +160,6 @@ BOOST_AUTO_TEST_CASE(test_MaxQPSIPRule) {
   /* and we be back */
   BOOST_CHECK_EQUAL(rule->getEntriesCount(), 1U);
 
-
   /* Let's insert a lot of different sources now */
   for (size_t idxByte3 = 0; idxByte3 < 256; idxByte3++) {
     for (size_t idxByte4 = 0; idxByte4 < 256; idxByte4++) {
@@ -201,7 +202,8 @@ BOOST_AUTO_TEST_CASE(test_MaxQPSIPRule) {
   BOOST_CHECK_EQUAL(scanned, 0U);
 }
 
-BOOST_AUTO_TEST_CASE(test_poolOutstandingRule) {
+BOOST_AUTO_TEST_CASE(test_poolOutstandingRule)
+{
   auto dq = getDQ();
 
   ServerPool sp{};
@@ -227,7 +229,8 @@ BOOST_AUTO_TEST_CASE(test_poolOutstandingRule) {
   BOOST_CHECK_EQUAL(pOR2.matches(&dq), false);
 }
 
-BOOST_AUTO_TEST_CASE(test_payloadSizeRule) {
+BOOST_AUTO_TEST_CASE(test_payloadSizeRule)
+{
   auto dnsQuestion = getDQ();
 
   {
@@ -298,8 +301,8 @@ BOOST_AUTO_TEST_CASE(test_payloadSizeRule) {
   BOOST_CHECK_THROW(PayloadSizeRule("invalid", 42U), std::runtime_error);
 
   std::vector<RuleParameter> parameters{
-    RuleParameter{ "qps", 5U },
-    RuleParameter{ "ipv4-truncation", 24U },
+    RuleParameter{"qps", 5U},
+    RuleParameter{"ipv4-truncation", 24U},
   };
   auto got = buildSelector("TestMaxQPSIPRule", parameters);
 }
index 7104c75ec18f24b50fcabed700f48178ebfd0ec9..9f4bac69416c9de11414095037aec219e45898ac 100644 (file)
@@ -123,9 +123,20 @@ BOOST_AUTO_TEST_SUITE(test_dnsdisttcp_cc)
 struct ExpectedStep
 {
 public:
-  enum class ExpectedRequest { handshakeClient, readFromClient, writeToClient, closeClient, connectToBackend, readFromBackend, writeToBackend, closeBackend };
-
-  ExpectedStep(ExpectedRequest r, IOState n, size_t b = 0, std::function<void(int descriptor)> fn = nullptr): cb(fn), request(r), nextState(n), bytes(b)
+  enum class ExpectedRequest
+  {
+    handshakeClient,
+    readFromClient,
+    writeToClient,
+    closeClient,
+    connectToBackend,
+    readFromBackend,
+    writeToBackend,
+    closeBackend
+  };
+
+  ExpectedStep(ExpectedRequest r, IOState n, size_t b = 0, std::function<void(int descriptor)> fn = nullptr) :
+    cb(fn), request(r), nextState(n), bytes(b)
   {
   }
 
@@ -142,23 +153,24 @@ static PacketBuffer s_writeBuffer;
 static PacketBuffer s_backendReadBuffer;
 static PacketBuffer s_backendWriteBuffer;
 
-std::ostream& operator<<(std::ostream &os, const ExpectedStep::ExpectedRequest d);
+std::ostream& operator<<(std::ostreamos, const ExpectedStep::ExpectedRequest d);
 
-std::ostream& operator<<(std::ostream &os, const ExpectedStep::ExpectedRequest d)
+std::ostream& operator<<(std::ostreamos, const ExpectedStep::ExpectedRequest d)
 {
-  static const std::vector<std::string> requests = { "handshake with client", "read from client", "write to client", "close connection to client", "connect to the backend", "read from the backend", "write to the backend", "close connection to backend" };
-  os<<requests.at(static_cast<size_t>(d));
+  static const std::vector<std::string> requests = {"handshake with client", "read from client", "write to client", "close connection to client", "connect to the backend", "read from the backend", "write to the backend", "close connection to backend"};
+  os << requests.at(static_cast<size_t>(d));
   return os;
 }
 
 class MockupTLSConnection : public TLSConnection
 {
 public:
-  MockupTLSConnection(int descriptor, bool client = false): d_descriptor(descriptor), d_client(client)
+  MockupTLSConnection(int descriptor, bool client = false) :
+    d_descriptor(descriptor), d_client(client)
   {
   }
 
-  ~MockupTLSConnection() { }
+  ~MockupTLSConnection() {}
 
   IOState tryHandshake() override
   {
@@ -194,7 +206,7 @@ public:
     return step.nextState;
   }
 
-  IOState tryRead(PacketBuffer& buffer, size_t& pos, size_t toRead, bool allowIncomplete=false) override
+  IOState tryRead(PacketBuffer& buffer, size_t& pos, size_t toRead, bool allowIncomplete = false) override
   {
     (void)allowIncomplete;
     auto step = getStep();
@@ -297,7 +309,7 @@ public:
     (void)timeout;
   }
 
-  size_t read(void* buffer, size_t bufferSize, const struct timeval&readTimeout, const struct timeval& totalTimeout={0,0}, bool allowIncomplete=false) override
+  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;
@@ -314,6 +326,7 @@ public:
     (void)writeTimeout;
     return 0;
   }
+
 private:
   ExpectedStep getStep() const
   {
@@ -381,7 +394,7 @@ public:
   {
   }
 
-  int run(struct timeval* tv, int timeout=500) override
+  int run(struct timeval* tv, int timeout = 500) override
   {
     (void)timeout;
     int ret = 0;
@@ -533,9 +546,9 @@ struct TestFixture
 static void testInit(const std::string& name, TCPClientThreadData& threadData)
 {
 #ifdef DEBUGLOG_ENABLED
-  cerr<<name<<endl;
+  cerr << name << endl;
 #else
-  (void) name;
+  (void)name;
 #endif
 
   TestFixture::reset();
@@ -563,7 +576,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_SelfAnswered, TestFixture)
   pwQ.getHeader()->rd = 1;
 
   uint16_t querySize = static_cast<uint16_t>(query.size());
-  const uint8_t sizeBytes[] = { static_cast<uint8_t>(querySize / 256), static_cast<uint8_t>(querySize % 256) };
+  const uint8_t sizeBytes[] = {static_cast<uint8_t>(querySize / 256), static_cast<uint8_t>(querySize % 256)};
   query.insert(query.begin(), sizeBytes, sizeBytes + 2);
 
   {
@@ -572,10 +585,10 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_SelfAnswered, TestFixture)
     s_readBuffer = query;
 
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
-      { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2},
+      {ExpectedStep::ExpectedRequest::closeClient, IOState::Done},
     };
     s_processQuery = [](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
       (void)dq;
@@ -594,12 +607,12 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_SelfAnswered, TestFixture)
     s_readBuffer = query;
 
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, 65537 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0 },
-      { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2},
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, 65537},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0},
+      {ExpectedStep::ExpectedRequest::closeClient, IOState::Done},
     };
     s_processQuery = [](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
       (void)dq;
@@ -623,17 +636,17 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_SelfAnswered, TestFixture)
     s_readBuffer = query;
 
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::NeedWrite },
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::NeedRead },
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 1 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 1 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, query.size() - 3 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 1 },
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::NeedWrite, query.size() - 1},
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, 1 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0 },
-      { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::NeedWrite},
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::NeedRead},
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 1},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 1},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, query.size() - 3},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 1},
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::NeedWrite, query.size() - 1},
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, 1},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0},
+      {ExpectedStep::ExpectedRequest::closeClient, IOState::Done},
     };
     s_processQuery = [](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
       (void)dq;
@@ -660,10 +673,10 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_SelfAnswered, TestFixture)
     s_readBuffer = query;
 
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
-      { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2},
+      {ExpectedStep::ExpectedRequest::closeClient, IOState::Done},
     };
     s_processQuery = [](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
       (void)dq;
@@ -682,16 +695,16 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_SelfAnswered, TestFixture)
     /* 10k self-generated REFUSED pipelined on the same connection */
     size_t count = 10000;
 
-    s_steps = { { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done } };
+    s_steps = {{ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done}};
 
     for (size_t idx = 0; idx < count; idx++) {
       s_readBuffer.insert(s_readBuffer.end(), query.begin(), query.end());
-      s_steps.push_back({ ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 });
-      s_steps.push_back({ ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 });
-      s_steps.push_back({ ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, query.size() + 2 });
+      s_steps.push_back({ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2});
+      s_steps.push_back({ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2});
+      s_steps.push_back({ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, query.size() + 2});
     };
-    s_steps.push_back({ ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0 });
-    s_steps.push_back({ ExpectedStep::ExpectedRequest::closeClient, IOState::Done });
+    s_steps.push_back({ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0});
+    s_steps.push_back({ExpectedStep::ExpectedRequest::closeClient, IOState::Done});
 
     s_processQuery = [](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
       (void)dq;
@@ -711,10 +724,10 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_SelfAnswered, TestFixture)
     s_readBuffer = query;
 
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, query.size() - 2 - 2 },
-      { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, query.size() - 2 - 2},
+      {ExpectedStep::ExpectedRequest::closeClient, IOState::Done},
     };
     s_processQuery = [](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
       (void)dq;
@@ -750,11 +763,11 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_SelfAnswered, TestFixture)
     s_readBuffer = query;
 
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::NeedWrite, 1 },
-      { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2},
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::NeedWrite, 1},
+      {ExpectedStep::ExpectedRequest::closeClient, IOState::Done},
     };
     s_processQuery = [](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
       (void)dq;
@@ -788,11 +801,11 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_SelfAnswered, TestFixture)
     s_readBuffer = query;
 
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, 0 },
-      { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2},
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, 0},
+      {ExpectedStep::ExpectedRequest::closeClient, IOState::Done},
     };
     s_processQuery = [](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
       (void)dq;
@@ -825,7 +838,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionWithProxyProtocol_SelfAnswered, T
   pwQ.getHeader()->rd = 1;
 
   uint16_t querySize = static_cast<uint16_t>(query.size());
-  const uint8_t sizeBytes[] = { static_cast<uint8_t>(querySize / 256), static_cast<uint8_t>(querySize % 256) };
+  const uint8_t sizeBytes[] = {static_cast<uint8_t>(querySize / 256), static_cast<uint8_t>(querySize % 256)};
   query.insert(query.begin(), sizeBytes, sizeBytes + 2);
 
   {
@@ -845,17 +858,17 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionWithProxyProtocol_SelfAnswered, T
     s_readBuffer.insert(s_readBuffer.end(), query.begin(), query.end());
 
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, s_proxyProtocolMinimumHeaderSize },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, proxyPayload.size() - s_proxyProtocolMinimumHeaderSize },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, 65537 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, 65537 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0 },
-      { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, s_proxyProtocolMinimumHeaderSize},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, proxyPayload.size() - s_proxyProtocolMinimumHeaderSize},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2},
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, 65537},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2},
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, 65537},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0},
+      {ExpectedStep::ExpectedRequest::closeClient, IOState::Done},
     };
     s_processQuery = [](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
       (void)dq;
@@ -888,9 +901,9 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionWithProxyProtocol_SelfAnswered, T
     s_readBuffer.insert(s_readBuffer.begin(), proxyPayload.begin(), proxyPayload.end());
 
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, s_proxyProtocolMinimumHeaderSize },
-      { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, s_proxyProtocolMinimumHeaderSize},
+      {ExpectedStep::ExpectedRequest::closeClient, IOState::Done},
     };
     s_processQuery = [](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
       (void)dq;
@@ -919,10 +932,10 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionWithProxyProtocol_SelfAnswered, T
     s_readBuffer.insert(s_readBuffer.begin(), proxyPayload.begin(), proxyPayload.end());
 
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, s_proxyProtocolMinimumHeaderSize },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, proxyPayload.size() - s_proxyProtocolMinimumHeaderSize - 1},
-      { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, s_proxyProtocolMinimumHeaderSize},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, proxyPayload.size() - s_proxyProtocolMinimumHeaderSize - 1},
+      {ExpectedStep::ExpectedRequest::closeClient, IOState::Done},
     };
     s_processQuery = [](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
       (void)dq;
@@ -972,11 +985,11 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_BackendNoOOOR, TestFixture)
   auto shortQuery = query;
   shortQuery.resize(sizeof(dnsheader) - 1);
   uint16_t shortQuerySize = static_cast<uint16_t>(shortQuery.size());
-  const uint8_t shortSizeBytes[] = { static_cast<uint8_t>(shortQuerySize / 256), static_cast<uint8_t>(shortQuerySize % 256) };
+  const uint8_t shortSizeBytes[] = {static_cast<uint8_t>(shortQuerySize / 256), static_cast<uint8_t>(shortQuerySize % 256)};
   shortQuery.insert(shortQuery.begin(), shortSizeBytes, shortSizeBytes + 2);
 
   uint16_t querySize = static_cast<uint16_t>(query.size());
-  const uint8_t sizeBytes[] = { static_cast<uint8_t>(querySize / 256), static_cast<uint8_t>(querySize % 256) };
+  const uint8_t sizeBytes[] = {static_cast<uint8_t>(querySize / 256), static_cast<uint8_t>(querySize % 256)};
   query.insert(query.begin(), sizeBytes, sizeBytes + 2);
 
   auto backend = std::make_shared<DownstreamState>(getBackendAddress("42", 53));
@@ -990,20 +1003,20 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_BackendNoOOOR, TestFixture)
     s_backendReadBuffer = query;
 
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2},
       /* opening a connection to the backend */
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, query.size() - 2 },
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, query.size() },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0 },
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size()},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, query.size() - 2},
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, query.size()},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0},
       /* closing client connection */
-      { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeClient, IOState::Done},
       /* closing a connection to the backend */
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
     };
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
       (void)dq;
@@ -1036,18 +1049,18 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_BackendNoOOOR, TestFixture)
     s_backendReadBuffer = query;
 
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2},
       /* opening a connection to the backend */
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, query.size() - 2 },
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size()},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, query.size() - 2},
       /* closing client connection */
-      { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeClient, IOState::Done},
       /* closing a connection to the backend */
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
     };
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
       (void)dq;
@@ -1079,18 +1092,18 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_BackendNoOOOR, TestFixture)
     s_backendReadBuffer = query;
 
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2},
       /* opening a connection to the backend */
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, query.size() - 2 },
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size()},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, query.size() - 2},
       /* closing client connection */
-      { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeClient, IOState::Done},
       /* closing a connection to the backend */
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
     };
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
       (void)dq;
@@ -1126,18 +1139,18 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_BackendNoOOOR, TestFixture)
     s_backendReadBuffer = responsePacket;
 
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2},
       /* opening a connection to the backend */
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, query.size() - 2 },
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size()},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, query.size() - 2},
       /* closing client connection */
-      { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeClient, IOState::Done},
       /* closing a connection to the backend */
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
     };
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
       (void)dq;
@@ -1166,10 +1179,10 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_BackendNoOOOR, TestFixture)
     s_readBuffer = shortQuery;
 
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
       /* closing client connection */
-      { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeClient, IOState::Done},
     };
     s_processQuery = [](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
       (void)dq;
@@ -1200,18 +1213,18 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_BackendNoOOOR, TestFixture)
     s_backendReadBuffer = shortQuery;
 
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size()},
       /* opening a connection to the backend */
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, query.size() - 2 },
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size()},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, query.size() - 2},
       /* closing client connection */
-      { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeClient, IOState::Done},
       /* closing backend connection */
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
     };
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
       (void)dq;
@@ -1247,42 +1260,41 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_BackendNoOOOR, TestFixture)
     appendPayloadEditingID(s_backendReadBuffer, query, 1);
 
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2},
       /* connect to backend */
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::NeedWrite, 0, [&threadData](int desc) {
-          /* set the outgoing descriptor (backend connection) as ready */
-          dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
-        }
-      },
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::NeedWrite, 0, [&threadData](int desc) {
+         /* set the outgoing descriptor (backend connection) as ready */
+         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
+       }},
       /* send query */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::NeedWrite, 1 },
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() - 1 },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::NeedWrite, 1},
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() - 1},
       /* read response */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 1 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 1 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, query.size() - 3 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 1 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 1},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 1},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, query.size() - 3},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 1},
       /* write response to client */
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::NeedWrite, query.size() - 1 },
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, 1 },
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::NeedWrite, query.size() - 1},
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, 1},
       /* read second query */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2},
       /* write second query to backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size()},
       /* read second response */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, query.size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, query.size() - 2},
       /* write second response */
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, query.size() },
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, query.size()},
       /* read from client */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0},
       /* close connection to client */
-      { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeClient, IOState::Done},
       /* close connection to the backend, eventually */
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
     };
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
@@ -1318,42 +1330,37 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_BackendNoOOOR, TestFixture)
     s_readBuffer = query;
 
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {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");
-        }
-      },
-      { 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");
+       }},
+      {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},
       /* closing client connection */
-      { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeClient, IOState::Done},
     };
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
@@ -1384,15 +1391,15 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_BackendNoOOOR, TestFixture)
     s_readBuffer = query;
 
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2},
       /* opening a connection to the backend (retrying 5 times) */
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::NeedWrite },
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::NeedWrite},
       /* closing client connection */
-      { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeClient, IOState::Done},
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
     };
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
@@ -1433,16 +1440,16 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_BackendNoOOOR, TestFixture)
     s_readBuffer = query;
 
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2},
       /* opening a connection to the backend */
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size()},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0},
       /* closing client connection */
-      { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeClient, IOState::Done},
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
     };
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
@@ -1483,27 +1490,27 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_BackendNoOOOR, TestFixture)
     s_readBuffer = query;
 
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2},
       /* opening a connection to the backend, connection closed on first write (5 attempts) */
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, 0 },
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, 0 },
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, 0 },
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, 0 },
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, 0 },
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, 0},
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, 0},
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, 0},
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, 0},
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, 0},
       /* closing client connection */
-      { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeClient, IOState::Done},
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
     };
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
@@ -1535,35 +1542,35 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_BackendNoOOOR, TestFixture)
     s_backendReadBuffer = query;
 
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2},
       /* opening a connection to the backend, connection closed on first write (5 attempts) */
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, 0 },
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, 0 },
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, 0 },
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, 0 },
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() },
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, 0},
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, 0},
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, 0},
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, 0},
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size()},
       /* reading the response */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, query.size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, query.size() - 2},
       /* send the response to the client */
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, query.size() },
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, query.size()},
       /* client closes the connection */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0},
       /* closing client connection */
-      { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeClient, IOState::Done},
       /* then eventually the backend one */
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
     };
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
@@ -1594,43 +1601,39 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_BackendNoOOOR, TestFixture)
     s_readBuffer = query;
 
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2},
       /* opening a connection to the backend, connection closed on first write */
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, 0 },
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, 0},
+      {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 },
+      {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 },
+      {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 },
+      {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");
-        }
-      },
-      { 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},
       /* closing client connection */
-      { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeClient, IOState::Done},
     };
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
@@ -1661,32 +1664,32 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_BackendNoOOOR, TestFixture)
     s_readBuffer = query;
 
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2},
       /* opening a connection to the backend, connection closed on read, 5 attempts, last one succeeds */
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 0 },
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 0 },
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 0 },
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 0 },
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 0 },
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size()},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 0},
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size()},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 0},
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size()},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 0},
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size()},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 0},
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size()},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 0},
       /* closing client connection */
-      { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeClient, IOState::Done},
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
     };
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
@@ -1718,39 +1721,39 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_BackendNoOOOR, TestFixture)
     s_backendReadBuffer = query;
 
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2},
       /* opening a connection to the backend, connection closed on read, 5 attempts, last one succeeds */
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 0 },
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 0 },
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 0 },
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 0 },
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size()},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 0},
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size()},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 0},
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size()},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 0},
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size()},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 0},
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
       /* this time it works */
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, query.size() - 2 },
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size()},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, query.size() - 2},
       /* sending the response to the client */
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, query.size() },
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, query.size()},
       /* client closes the connection */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0},
       /* closing client connection */
-      { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeClient, IOState::Done},
       /* the eventually the backend one */
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
     };
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
@@ -1782,20 +1785,20 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_BackendNoOOOR, TestFixture)
     s_backendReadBuffer = query;
 
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2},
       /* opening a connection to the backend */
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, query.size() - 2 },
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size()},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, query.size() - 2},
       /* sending the response to the client, the connection has been closed */
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, 0 },
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, 0},
       /* closing client connection */
-      { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeClient, IOState::Done},
       /* and eventually the backend one */
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
     };
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
@@ -1838,32 +1841,31 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_BackendNoOOOR, TestFixture)
       appendPayloadEditingID(s_backendReadBuffer, query, idx);
     }
 
-    s_steps = { { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
-                { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-                { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
-                /* opening a connection to the backend */
-                { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
-                { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() + 2 },
-                { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-                { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, query.size() - 2 },
-                { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, query.size() + 2 }
-    };
+    s_steps = {{ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
+               {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+               {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2},
+               /* opening a connection to the backend */
+               {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+               {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() + 2},
+               {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+               {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, query.size() - 2},
+               {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, query.size() + 2}};
 
     for (size_t idx = 0; idx < count - 1; idx++) {
       /* read a new query */
-      s_steps.push_back({ ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 });
-      s_steps.push_back({ ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 });
+      s_steps.push_back({ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2});
+      s_steps.push_back({ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2});
       /* pass it to the backend */
-      s_steps.push_back({ ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() + 2 });
-      s_steps.push_back({ ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 });
-      s_steps.push_back({ ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, query.size() - 2 });
+      s_steps.push_back({ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() + 2});
+      s_steps.push_back({ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2});
+      s_steps.push_back({ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, query.size() - 2});
       /* send the response */
-      s_steps.push_back({ ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, query.size() + 2 });
+      s_steps.push_back({ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, query.size() + 2});
     };
     /* close the connection with the backend */
-    s_steps.push_back({ ExpectedStep::ExpectedRequest::closeBackend, IOState::Done });
+    s_steps.push_back({ExpectedStep::ExpectedRequest::closeBackend, IOState::Done});
     /* close the connection with the client */
-    s_steps.push_back({ ExpectedStep::ExpectedRequest::closeClient, IOState::Done });
+    s_steps.push_back({ExpectedStep::ExpectedRequest::closeClient, IOState::Done});
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
       (void)dq;
@@ -1903,12 +1905,11 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnection_BackendNoOOOR, TestFixture)
       appendPayloadEditingID(s_backendReadBuffer, query, idx);
     }
 
-    s_steps = { { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
-                { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-                { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
-                /* close the connection with the client */
-                { ExpectedStep::ExpectedRequest::closeClient, IOState::Done }
-    };
+    s_steps = {{ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
+               {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+               {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2},
+               /* close the connection with the client */
+               {ExpectedStep::ExpectedRequest::closeClient, IOState::Done}};
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
       (void)dq;
@@ -1971,7 +1972,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
     pwQ.getHeader()->rd = 1;
     pwQ.getHeader()->id = htons(counter);
     uint16_t querySize = static_cast<uint16_t>(query.size());
-    const uint8_t sizeBytes[] = { static_cast<uint8_t>(querySize / 256), static_cast<uint8_t>(querySize % 256) };
+    const uint8_t sizeBytes[] = {static_cast<uint8_t>(querySize / 256), static_cast<uint8_t>(querySize % 256)};
     query.insert(query.begin(), sizeBytes, sizeBytes + 2);
     totalQueriesSize += query.size();
     ++counter;
@@ -1991,7 +1992,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
     pwR.commit();
 
     uint16_t responseSize = static_cast<uint16_t>(response.size());
-    const uint8_t sizeBytes[] = { static_cast<uint8_t>(responseSize / 256), static_cast<uint8_t>(responseSize % 256) };
+    const uint8_t sizeBytes[] = {static_cast<uint8_t>(responseSize / 256), static_cast<uint8_t>(responseSize % 256)};
     response.insert(response.begin(), sizeBytes, sizeBytes + 2);
     totalResponsesSize += response.size();
     ++counter;
@@ -2016,90 +2017,90 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
     }
 
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
       /* reading a query from the client (1) */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(0).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(0).size() - 2},
       /* opening a connection to the backend */
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
       /* sending query to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(0).size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(0).size()},
       /* no response ready yet */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0},
       /* reading a query from the client (2) */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(1).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(1).size() - 2},
       /* sending query to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(1).size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(1).size()},
       /* no response ready yet */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0},
       /* reading a query from the client (3) */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(2).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(2).size() - 2},
       /* sending query to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(2).size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(2).size()},
       /* no response ready yet */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0},
       /* reading a query from the client (4) */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(3).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(3).size() - 2},
       /* sending query to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(3).size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(3).size()},
       /* no response ready yet */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0},
       /* reading a query from the client (5) */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(4).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(4).size() - 2},
       /* sending query to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(4).size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(4).size()},
       /* no response ready yet, but the backend becomes ready */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0, [&threadData](int desc) {
-        /* set the outgoing descriptor (backend connection) as ready */
-        dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
-      },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0, [&threadData](int desc) {
+         /* set the outgoing descriptor (backend connection) as ready */
+         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
+       }},
 
       /* no more queries from the client */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0},
 
       /* reading a response from the backend */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(4).size() - 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(4).size() },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(4).size() - 2},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(4).size()},
       /* sending it to the client */
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(4).size() },
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(4).size()},
 
       /* reading a response from the backend */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(3).size() - 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(3).size() },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(3).size() - 2},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(3).size()},
       /* sending it to the client */
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(3).size() },
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(3).size()},
 
       /* reading a response from the backend */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(2).size() - 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(2).size() },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(2).size() - 2},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(2).size()},
       /* sending it to the client */
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(2).size() },
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(2).size()},
 
       /* reading a response from the backend */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(1).size() - 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(1).size() },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(1).size() - 2},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(1).size()},
       /* sending it to the client */
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(1).size() },
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(1).size()},
 
       /* reading a response from the backend */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size() - 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size() },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size() - 2},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size()},
       /* sending it to the client, the client descriptor becomes ready */
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(0).size(), [&threadData](int desc) {
-        /* set the incoming descriptor (client connection) as ready */
-        dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
-      },
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(0).size(), [&threadData](int desc) {
+         /* set the incoming descriptor (client connection) as ready */
+         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
+       }},
 
       /* client is closing the connection */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0},
       /* closing client connection */
-      { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeClient, IOState::Done},
       /* closing a connection to the backend */
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
     };
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
@@ -2162,76 +2163,76 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
 
     bool timeout = false;
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
       /* reading a query from the client (1) */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(0).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(0).size() - 2},
       /* opening a connection to the backend */
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
       /* sending query to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(0).size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(0).size()},
       /* no response ready yet */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0},
       /* reading a query from the client (2) */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(1).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(1).size() - 2},
       /* sending query to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(1).size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(1).size()},
       /* no response ready yet */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0},
       /* reading a query from the client (3) */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(2).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(2).size() - 2},
       /* sending query to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(2).size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(2).size()},
       /* no response ready yet */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0},
       /* reading a query from the client (4) */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(3).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(3).size() - 2},
       /* sending the response right away (self-answered)  */
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(3).size() },
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(3).size()},
       /* reading a query from the client (5) */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(4).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(4).size() - 2},
       /* sending query to the backend (5) */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(4).size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(4).size()},
       /* reading a response from the backend (1) */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size() - 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size(), [&threadData](int desc) {
-        /* set the backend descriptor as ready */
-        dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
-      },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size() - 2},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size(), [&threadData](int desc) {
+         /* set the backend descriptor as ready */
+         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
+       }},
       /* sending it to the client (1) */
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(0).size(), [&threadData](int desc) {
-        /* set the client descriptor as NOT ready */
-        dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
-      },
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(0).size(), [&threadData](int desc) {
+         /* set the client descriptor as NOT ready */
+         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
+       }},
       /* reading a response from the backend (5) */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(4).size() - 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(4).size() },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(4).size() - 2},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(4).size()},
       /* sending it to the client (5) */
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(4).size() },
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(4).size()},
 
       /* try to read from the backend but there is no answer ready yet */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0, [&threadData, &timeout](int desc) {
-        /* set the backend descriptor as NOT ready */
-        dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
-        timeout = true;
-      },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0, [&threadData, &timeout](int desc) {
+         /* set the backend descriptor as NOT ready */
+         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
+         timeout = true;
+       }},
       /* reading from the client (not ready) */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0},
 
       /* A timeout occurs */
 
       /* closing client connection */
-      { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeClient, IOState::Done},
 
       /* closing a connection to the backend */
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
     };
 
-    s_processQuery = [backend,&responses](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+    s_processQuery = [backend, &responses](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
       static size_t count = 0;
       if (count++ == 3) {
         /* self answered */
@@ -2315,116 +2316,116 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
     bool timeout = false;
     int backendDesc;
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
       /* reading a query from the client (1) */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(0).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(0).size() - 2},
       /* opening a connection to the backend */
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
       /* sending query to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(0).size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(0).size()},
       /* read response size and the beginning of the response (1) from the backend */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 1, [&threadData](int desc) {
-        /* set the backend descriptor as ready */
-        dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
-      },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 1, [&threadData](int desc) {
+         /* set the backend descriptor as ready */
+         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
+       }},
       /* reading a query from the client (2) */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(1).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(1).size() - 2},
       /* trying to read an additional query, if any */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0, [&threadData](int desc) {
-        /* set the client descriptor as NOT ready */
-        dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
-      },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0, [&threadData](int desc) {
+         /* set the client descriptor as NOT ready */
+         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
+       }},
       /* reading the remaining bytes of response (1) from the backend */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size() - 3 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size() - 3},
       /* sending response (1) to the client */
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(0).size() },
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(0).size()},
       /* sending query (2) to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(1).size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(1).size()},
       /* the response (2) is already there */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(1).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(1).size() - 2},
       /* sending response (2) to the client */
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(1).size(), [&threadData](int desc) {
-        /* set the client descriptor as ready */
-        dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
-      },
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(1).size(), [&threadData](int desc) {
+         /* set the client descriptor as ready */
+         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
+       }},
       /* reading a query from the client (3) */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(2).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(2).size() - 2},
       /* sending query to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, 0 },
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, 0},
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
       /* opening a connection to the backend */
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
       /* sending query (3) to the backend, short write */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::NeedWrite, 1, [&threadData,&backendDesc](int desc) {
-        /* set the backend descriptor as NOT ready */
-        dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
-        backendDesc = desc;
-        /* but client is ready */
-        dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(-1);
-      },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::NeedWrite, 1, [&threadData, &backendDesc](int desc) {
+         /* set the backend descriptor as NOT ready */
+         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
+         backendDesc = desc;
+         /* but client is ready */
+         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(-1);
+       }},
       /* reading a query from the client (4) */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(3).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(3).size() - 2},
       /* 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);
-      },
+      {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);
+       }},
       /* nothing else to read from the client for now */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0, [&threadData](int desc) {
-        /* set the client descriptor as NOT ready */
-        dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
-      },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0, [&threadData](int desc) {
+         /* set the client descriptor as NOT ready */
+         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
+       }},
       /* finishing sending the query (3) to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(2).size() - 1 },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(2).size() - 1},
       /* sending the query (4) to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(3).size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(3).size()},
       /* sending the query (5) to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(4).size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(4).size()},
       /* reading a response from the backend (3) */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(2).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(2).size() - 2},
       /* sending it to the client (3) */
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(2).size() },
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(2).size()},
       /* reading a response from the backend (4) */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(3).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(3).size() - 2},
       /* sending it to the client (4) but short write */
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::NeedWrite, responses.at(3).size() - 1, [&threadData](int desc) {
-        /* set the client descriptor as NOT ready */
-        dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
-      },
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::NeedWrite, responses.at(3).size() - 1, [&threadData](int desc) {
+         /* set the client descriptor as NOT ready */
+         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
+       }},
       /* 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);
-      },
+      {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);
+       }},
       /* resume sending it to the client (4) */
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, 1 },
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, 1},
       /* sending it to the client (5) */
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(4).size() },
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(4).size()},
 
       /* nothing to read from the client, then timeout later */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0, [&threadData,&timeout](int desc) {
-        /* set the client descriptor as NOT ready */
-        dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
-        timeout = true;
-      },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0, [&threadData, &timeout](int desc) {
+         /* set the client descriptor as NOT ready */
+         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
+         timeout = true;
+       }},
 
       /* closing a connection to the backend */
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
 
       /* closing client connection */
-      { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeClient, IOState::Done},
     };
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
@@ -2481,30 +2482,30 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
 
     bool timeout = false;
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
       /* reading a query from the client (1) */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(0).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(0).size() - 2},
       /* opening a connection to the backend */
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
       /* sending query to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(0).size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(0).size()},
       /* no response ready yet */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0},
       /* reading a second query from the client */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(1).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {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;
-      },
+      {ExpectedStep::ExpectedRequest::closeClient, IOState::Done, 0, [&timeout](int desc) {
+         (void)desc;
+         timeout = true;
+       }},
       /* closing a connection to the backend after a timeout */
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
     };
 
     counter = 0;
-    s_processQuery = [backend,&counter](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+    s_processQuery = [backend, &counter](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
       (void)dq;
       if (counter == 0) {
         ++counter;
@@ -2563,36 +2564,36 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
 
     int backendDescriptor = -1;
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
       /* reading a query from the client (1) */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(0).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(0).size() - 2},
       /* opening a connection to the backend */
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [&backendDescriptor](int desc) {
-        backendDescriptor = desc;
-      },
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [&backendDescriptor](int desc) {
+         backendDescriptor = desc;
+       }},
       /* sending query to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(0).size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(0).size()},
       /* no response ready yet */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0},
       /* reading a second query from the client */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(1).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {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);
-      },
+      {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);
+       }},
       /* reading the response to the first query from the backend */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size() - 2},
       /* closing a connection to the backend */
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
     };
 
     counter = 0;
-    s_processQuery = [backend,&counter](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+    s_processQuery = [backend, &counter](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
       (void)dq;
       if (counter == 0) {
         ++counter;
@@ -2653,69 +2654,69 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
     bool timeout = false;
     int backendDescriptor = -1;
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
       /* reading a query from the client (1) */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(0).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(0).size() - 2},
       /* opening a connection to the backend */
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
       /* sending query (1) to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(0).size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(0).size()},
       /* no response ready yet */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0},
       /* reading a second query from the client */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(1).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(1).size() - 2},
       /* sending query (2) to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(1).size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(1).size()},
       /* no response ready yet */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0, [&timeout,&backendDescriptor](int desc) {
-        backendDescriptor = desc;
-        timeout = true;
-      },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0, [&timeout, &backendDescriptor](int desc) {
+         backendDescriptor = desc;
+         timeout = true;
+       }},
       /* nothing from the client either */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0},
       /* the client times out, and we will set the backend descriptor to ready at that point */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(1).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(1).size() - 2},
       /* sending response (2) to the client */
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(1).size() },
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(1).size()},
       /* reading the response (1) from the backend */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size() - 2},
       /* sending response (1) to the client */
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(0).size(), [&threadData](int desc) {
-        /* setting the client descriptor ready */
-        dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
-      },
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(0).size(), [&threadData](int desc) {
+         /* setting the client descriptor ready */
+         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
+       }},
       /* try to read from the client again, get query (3) */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(4).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(4).size() - 2},
       /* sending query (3) to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(4).size() },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0, [&threadData](int desc) {
-        /* setting the backend descriptor NOT ready */
-        dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
-      },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(4).size()},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0, [&threadData](int desc) {
+         /* setting the backend descriptor NOT ready */
+         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
+       }},
       /* try to read from the client again, nothing yet */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0, [&threadData,&backendDescriptor](int desc) {
-        /* the client descriptor becomes NOT ready */
-        dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
-        /* the backend one is ready, though */
-        dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(backendDescriptor);
-      },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0, [&threadData, &backendDescriptor](int desc) {
+         /* the client descriptor becomes NOT ready */
+         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
+         /* the backend one is ready, though */
+         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(backendDescriptor);
+       }},
       /* reading the response (3) from the backend */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(4).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+      {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;
-      },
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(4).size(), [&timeout](int desc) {
+         (void)desc;
+         timeout = true;
+       }},
       /* closing a connection to the backend */
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
       /* client times out again, this time we close the connection */
-      { ExpectedStep::ExpectedRequest::closeClient, IOState::Done, 0 },
+      {ExpectedStep::ExpectedRequest::closeClient, IOState::Done, 0},
     };
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
@@ -2793,91 +2794,91 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
     expectedWriteBuffer = s_backendReadBuffer;
 
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
       /* reading a query from the client (1) */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(0).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(0).size() - 2},
       /* opening a connection to the backend */
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
       /* sending query (1) to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(0).size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(0).size()},
       /* no response ready yet */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0},
       /* reading a second query from the client */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(1).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(1).size() - 2},
       /* sending query (2) to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(1).size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(1).size()},
       /* no response ready yet */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0},
       /* reading a third query from the client */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(2).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(2).size() - 2},
       /* sending query (3) to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(2).size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(2).size()},
       /* no response ready yet but the backend descriptor becomes ready */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0, [&threadData](int desc) {
-        /* the backend descriptor becomes ready */
-        dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
-      },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0, [&threadData](int desc) {
+         /* the backend descriptor becomes ready */
+         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
+       }},
       /* nothing from the client either */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0, [&threadData](int desc) {
-        /* the client descriptor is NOT ready */
-        dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
-      },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0, [&threadData](int desc) {
+         /* the client descriptor is NOT ready */
+         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
+       }},
       /* read the response (2) from the backend  */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(1).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(1).size() - 2},
       /* trying to send response (2) to the client but blocking */
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::NeedWrite, 0 },
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::NeedWrite, 0},
       /* reading the response (1) from the backend */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size() - 2},
       /* trying to read from the backend again, connection closes on us */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 0 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 0},
       /* so we close the connection */
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+      {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 },
+      {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 },
+      {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 },
+      {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 },
+      {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::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);
-      },
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done, 0, [&threadData](int desc) {
+         (void)desc;
+         /* the client descriptor is ready */
+         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(-1);
+       }},
       /* sending response (2) to the client */
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(1).size() },
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(1).size()},
       /* sending response (1) to the client */
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(0).size() },
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(0).size()},
       /* closing the client connection */
-      { ExpectedStep::ExpectedRequest::closeClient, IOState::Done, 0 },
+      {ExpectedStep::ExpectedRequest::closeClient, IOState::Done, 0},
     };
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
@@ -2920,7 +2921,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
     pwAXFRQuery.getHeader()->rd = 0;
     pwAXFRQuery.getHeader()->id = 42;
     uint16_t axfrQuerySize = static_cast<uint16_t>(axfrQuery.size());
-    const uint8_t axfrQuerySizeBytes[] = { static_cast<uint8_t>(axfrQuerySize / 256), static_cast<uint8_t>(axfrQuerySize % 256) };
+    const uint8_t axfrQuerySizeBytes[] = {static_cast<uint8_t>(axfrQuerySize / 256), static_cast<uint8_t>(axfrQuerySize % 256)};
     axfrQuery.insert(axfrQuery.begin(), axfrQuerySizeBytes, axfrQuerySizeBytes + 2);
 
     const DNSName name("powerdns.com.");
@@ -2948,7 +2949,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
       pwR.commit();
 
       uint16_t responseSize = static_cast<uint16_t>(response.size());
-      const uint8_t sizeBytes[] = { static_cast<uint8_t>(responseSize / 256), static_cast<uint8_t>(responseSize % 256) };
+      const uint8_t sizeBytes[] = {static_cast<uint8_t>(responseSize / 256), static_cast<uint8_t>(responseSize % 256)};
       response.insert(response.begin(), sizeBytes, sizeBytes + 2);
     }
     {
@@ -2964,7 +2965,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
       pwR.commit();
 
       uint16_t responseSize = static_cast<uint16_t>(response.size());
-      const uint8_t sizeBytes[] = { static_cast<uint8_t>(responseSize / 256), static_cast<uint8_t>(responseSize % 256) };
+      const uint8_t sizeBytes[] = {static_cast<uint8_t>(responseSize / 256), static_cast<uint8_t>(responseSize % 256)};
       response.insert(response.begin(), sizeBytes, sizeBytes + 2);
     }
     {
@@ -2991,7 +2992,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
       pwR.commit();
 
       uint16_t responseSize = static_cast<uint16_t>(response.size());
-      const uint8_t sizeBytes[] = { static_cast<uint8_t>(responseSize / 256), static_cast<uint8_t>(responseSize % 256) };
+      const uint8_t sizeBytes[] = {static_cast<uint8_t>(responseSize / 256), static_cast<uint8_t>(responseSize % 256)};
       response.insert(response.begin(), sizeBytes, sizeBytes + 2);
     }
 
@@ -3000,7 +3001,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
       pwSecondQuery.getHeader()->rd = 1;
       pwSecondQuery.getHeader()->id = 84;
       uint16_t secondQuerySize = static_cast<uint16_t>(secondQuery.size());
-      const uint8_t secondQuerySizeBytes[] = { static_cast<uint8_t>(secondQuerySize / 256), static_cast<uint8_t>(secondQuerySize % 256) };
+      const uint8_t secondQuerySizeBytes[] = {static_cast<uint8_t>(secondQuerySize / 256), static_cast<uint8_t>(secondQuerySize % 256)};
       secondQuery.insert(secondQuery.begin(), secondQuerySizeBytes, secondQuerySizeBytes + 2);
     }
 
@@ -3014,7 +3015,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
       pwSecondResponse.xfr32BitInt(0x01020304);
       pwSecondResponse.commit();
       uint16_t responseSize = static_cast<uint16_t>(secondResponse.size());
-      const uint8_t sizeBytes[] = { static_cast<uint8_t>(responseSize / 256), static_cast<uint8_t>(responseSize % 256) };
+      const uint8_t sizeBytes[] = {static_cast<uint8_t>(responseSize / 256), static_cast<uint8_t>(responseSize % 256)};
       secondResponse.insert(secondResponse.begin(), sizeBytes, sizeBytes + 2);
     }
 
@@ -3037,60 +3038,60 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
 
     bool timeout = false;
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
       /* reading a query from the client (1) */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, axfrQuery.size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, axfrQuery.size() - 2},
       /* opening a connection to the backend */
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
       /* sending query (1) to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, axfrQuery.size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, axfrQuery.size()},
       /* no response ready yet, but setting the backend descriptor readable */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0, [&threadData](int desc) {
-        /* the backend descriptor becomes ready */
-        dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
-      },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0, [&threadData](int desc) {
+         /* the backend descriptor becomes ready */
+         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
+       }},
       /* 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);
-      },
+      {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);
+       }},
       /* read the response (1) from the backend  */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, axfrResponses.at(0).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, axfrResponses.at(0).size() - 2},
       /* sending response (1) to the client */
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, axfrResponses.at(0).size() },
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, axfrResponses.at(0).size()},
       /* reading the response (2) from the backend */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, axfrResponses.at(1).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, axfrResponses.at(1).size() - 2},
       /* sending response (2) to the client */
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, axfrResponses.at(1).size() },
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, axfrResponses.at(1).size()},
       /* reading the response (3) from the backend */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, axfrResponses.at(2).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+      {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);
-      },
+      {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);
+       }},
       /* trying to read from the client, getting a second query */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, secondQuery.size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, secondQuery.size() - 2},
       /* sending query (2) to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, secondQuery.size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, secondQuery.size()},
       /* reading the response (4) from the backend */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, secondResponse.size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, secondResponse.size() - 2},
       /* sending response (4) to the client */
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, secondResponse.size() },
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, secondResponse.size()},
       /* trying to read from the client, getting EOF */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0},
       /* closing the client connection */
-      { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeClient, IOState::Done},
       /* closing the backend connection */
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
     };
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
@@ -3139,7 +3140,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
     pwAXFRQuery.getHeader()->rd = 0;
     pwAXFRQuery.getHeader()->id = 42;
     uint16_t axfrQuerySize = static_cast<uint16_t>(axfrQuery.size());
-    const uint8_t axfrQuerySizeBytes[] = { static_cast<uint8_t>(axfrQuerySize / 256), static_cast<uint8_t>(axfrQuerySize % 256) };
+    const uint8_t axfrQuerySizeBytes[] = {static_cast<uint8_t>(axfrQuerySize / 256), static_cast<uint8_t>(axfrQuerySize % 256)};
     axfrQuery.insert(axfrQuery.begin(), axfrQuerySizeBytes, axfrQuerySizeBytes + 2);
 
     const DNSName name("powerdns.com.");
@@ -3167,7 +3168,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
       pwR.commit();
 
       uint16_t responseSize = static_cast<uint16_t>(response.size());
-      const uint8_t sizeBytes[] = { static_cast<uint8_t>(responseSize / 256), static_cast<uint8_t>(responseSize % 256) };
+      const uint8_t sizeBytes[] = {static_cast<uint8_t>(responseSize / 256), static_cast<uint8_t>(responseSize % 256)};
       response.insert(response.begin(), sizeBytes, sizeBytes + 2);
     }
     {
@@ -3183,7 +3184,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
       pwR.commit();
 
       uint16_t responseSize = static_cast<uint16_t>(response.size());
-      const uint8_t sizeBytes[] = { static_cast<uint8_t>(responseSize / 256), static_cast<uint8_t>(responseSize % 256) };
+      const uint8_t sizeBytes[] = {static_cast<uint8_t>(responseSize / 256), static_cast<uint8_t>(responseSize % 256)};
       response.insert(response.begin(), sizeBytes, sizeBytes + 2);
     }
     {
@@ -3210,7 +3211,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
       pwR.commit();
 
       uint16_t responseSize = static_cast<uint16_t>(response.size());
-      const uint8_t sizeBytes[] = { static_cast<uint8_t>(responseSize / 256), static_cast<uint8_t>(responseSize % 256) };
+      const uint8_t sizeBytes[] = {static_cast<uint8_t>(responseSize / 256), static_cast<uint8_t>(responseSize % 256)};
       response.insert(response.begin(), sizeBytes, sizeBytes + 2);
     }
 
@@ -3231,45 +3232,45 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
 
     bool timeout = false;
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
       /* reading a query from the client (1) */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, axfrQuery.size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, axfrQuery.size() - 2},
       /* opening a connection to the backend */
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
       /* sending query (1) to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, proxyPayload.size() + axfrQuery.size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, proxyPayload.size() + axfrQuery.size()},
       /* no response ready yet, but setting the backend descriptor readable */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0, [&threadData](int desc) {
-        /* the backend descriptor becomes ready */
-        dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
-      },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0, [&threadData](int desc) {
+         /* the backend descriptor becomes ready */
+         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
+       }},
       /* 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);
-      },
+      {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);
+       }},
       /* read the response (1) from the backend  */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, axfrResponses.at(0).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, axfrResponses.at(0).size() - 2},
       /* sending response (1) to the client */
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, axfrResponses.at(0).size() },
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, axfrResponses.at(0).size()},
       /* reading the response (2) from the backend */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, axfrResponses.at(1).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, axfrResponses.at(1).size() - 2},
       /* sending response (2) to the client */
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, axfrResponses.at(1).size() },
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, axfrResponses.at(1).size()},
       /* reading the response (3) from the backend, get EOF!! */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 0 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 0},
       /* closing the backend connection */
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
       /* opening a connection to the backend */
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
       /* closing the client connection */
-      { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeClient, IOState::Done},
       /* closing the backend connection */
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
     };
 
     s_processQuery = [proxyEnabledBackend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
@@ -3314,7 +3315,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
       pwFirstQuery.getHeader()->rd = 1;
       pwFirstQuery.getHeader()->id = 84;
       uint16_t firstQuerySize = static_cast<uint16_t>(firstQuery.size());
-      const uint8_t firstQuerySizeBytes[] = { static_cast<uint8_t>(firstQuerySize / 256), static_cast<uint8_t>(firstQuerySize % 256) };
+      const uint8_t firstQuerySizeBytes[] = {static_cast<uint8_t>(firstQuerySize / 256), static_cast<uint8_t>(firstQuerySize % 256)};
       firstQuery.insert(firstQuery.begin(), firstQuerySizeBytes, firstQuerySizeBytes + 2);
     }
 
@@ -3335,7 +3336,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
       pwFirstResponse.commit();
 
       uint16_t responseSize = static_cast<uint16_t>(firstResponse.size());
-      const uint8_t sizeBytes[] = { static_cast<uint8_t>(responseSize / 256), static_cast<uint8_t>(responseSize % 256) };
+      const uint8_t sizeBytes[] = {static_cast<uint8_t>(responseSize / 256), static_cast<uint8_t>(responseSize % 256)};
       firstResponse.insert(firstResponse.begin(), sizeBytes, sizeBytes + 2);
     }
 
@@ -3344,7 +3345,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
       pwIXFRQuery.getHeader()->rd = 0;
       pwIXFRQuery.getHeader()->id = 42;
       uint16_t ixfrQuerySize = static_cast<uint16_t>(ixfrQuery.size());
-      const uint8_t ixfrQuerySizeBytes[] = { static_cast<uint8_t>(ixfrQuerySize / 256), static_cast<uint8_t>(ixfrQuerySize % 256) };
+      const uint8_t ixfrQuerySizeBytes[] = {static_cast<uint8_t>(ixfrQuerySize / 256), static_cast<uint8_t>(ixfrQuerySize % 256)};
       ixfrQuery.insert(ixfrQuery.begin(), ixfrQuerySizeBytes, ixfrQuerySizeBytes + 2);
     }
 
@@ -3437,7 +3438,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
       pwR.commit();
 
       uint16_t responseSize = static_cast<uint16_t>(response.size());
-      const uint8_t sizeBytes[] = { static_cast<uint8_t>(responseSize / 256), static_cast<uint8_t>(responseSize % 256) };
+      const uint8_t sizeBytes[] = {static_cast<uint8_t>(responseSize / 256), static_cast<uint8_t>(responseSize % 256)};
       response.insert(response.begin(), sizeBytes, sizeBytes + 2);
     }
 
@@ -3446,7 +3447,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
       pwSecondQuery.getHeader()->rd = 1;
       pwSecondQuery.getHeader()->id = 84;
       uint16_t secondQuerySize = static_cast<uint16_t>(secondQuery.size());
-      const uint8_t secondQuerySizeBytes[] = { static_cast<uint8_t>(secondQuerySize / 256), static_cast<uint8_t>(secondQuerySize % 256) };
+      const uint8_t secondQuerySizeBytes[] = {static_cast<uint8_t>(secondQuerySize / 256), static_cast<uint8_t>(secondQuerySize % 256)};
       secondQuery.insert(secondQuery.begin(), secondQuerySizeBytes, secondQuerySizeBytes + 2);
     }
 
@@ -3460,7 +3461,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
       pwSecondResponse.xfr32BitInt(0x01020304);
       pwSecondResponse.commit();
       uint16_t responseSize = static_cast<uint16_t>(secondResponse.size());
-      const uint8_t sizeBytes[] = { static_cast<uint8_t>(responseSize / 256), static_cast<uint8_t>(responseSize % 256) };
+      const uint8_t sizeBytes[] = {static_cast<uint8_t>(responseSize / 256), static_cast<uint8_t>(responseSize % 256)};
       secondResponse.insert(secondResponse.begin(), sizeBytes, sizeBytes + 2);
     }
 
@@ -3486,60 +3487,60 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
 
     bool timeout = false;
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
       /* reading a query from the client (1) */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, firstQuery.size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, firstQuery.size() - 2},
       /* opening a connection to the backend */
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
       /* sending query (1) to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, firstQuery.size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, firstQuery.size()},
       /* no response ready yet, but setting the backend descriptor readable */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0, [&threadData](int desc) {
-        /* the backend descriptor becomes ready */
-        dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
-      },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0, [&threadData](int desc) {
+         /* the backend descriptor becomes ready */
+         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
+       }},
       /* try to read a second query from the client, none yet */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0},
       /* read the response (1) from the backend  */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, firstResponse.size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+      {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);
-      },
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, firstResponse.size(), [&threadData](int desc) {
+         (void)desc;
+         /* client descriptor becomes ready */
+         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(-1);
+       }},
       /* reading a query from the client (2) */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, ixfrQuery.size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, ixfrQuery.size() - 2},
       /* sending query (2) to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, ixfrQuery.size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, ixfrQuery.size()},
       /* read the response (ixfr 1) from the backend  */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, ixfrResponses.at(0).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+      {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);
-      },
+      {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);
+       }},
       /* trying to read from the client, getting a second query */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, secondQuery.size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, secondQuery.size() - 2},
       /* sending query (2) to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, secondQuery.size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, secondQuery.size()},
       /* reading the response (4) from the backend */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, secondResponse.size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, secondResponse.size() - 2},
       /* sending response (4) to the client */
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, secondResponse.size() },
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, secondResponse.size()},
       /* trying to read from the client, getting EOF */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0},
       /* closing the client connection */
-      { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeClient, IOState::Done},
       /* closing the backend connection */
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
     };
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
@@ -3608,68 +3609,68 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
     expectedWriteBuffer.insert(expectedWriteBuffer.end(), responses.at(2).begin(), responses.at(2).end());
 
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
       /* reading a query from the client (1) */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(0).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(0).size() - 2},
       /* opening a connection to the backend */
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
       /* sending query (1) to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, proxyPayload.size() + queries.at(0).size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, proxyPayload.size() + queries.at(0).size()},
       /* got the response */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size() },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size()},
       /* sending the response (1) to the client */
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(0).size() },
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(0).size()},
       /* reading a second query from the client */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(1).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(1).size() - 2},
       /* sending query (2) to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(1).size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(1).size()},
       /* backend is not ready yet */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0},
       /* reading a third query from the client */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(2).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(2).size() - 2},
       /* sending query (3) to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(2).size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(2).size()},
       /* backend is not ready yet, but the descriptor becomes ready */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0, [&threadData](int desc) {
-        /* the backend descriptor becomes ready */
-        dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
-      }},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0, [&threadData](int desc) {
+         /* the backend descriptor becomes ready */
+         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
+       }},
       /* nothing from the client */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0, [&threadData](int desc) {
-        dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
-      },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0, [&threadData](int desc) {
+         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
+       }},
       /* backend closes the connection on us */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 0 },
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 0},
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
       /* opening a new connection to the backend */
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
       /* sending query (2) to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, proxyPayload.size() + queries.at(1).size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, proxyPayload.size() + queries.at(1).size()},
       /* sending query (3) to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(2).size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(2).size()},
       /* got the response for 2 */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(1).size() },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(1).size()},
       /* sending the response (2) to the client */
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(1).size() },
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(1).size()},
       /* got the response for 3 */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(2).size() },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(2).size()},
       /* sending the response (3) to the client */
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(2).size(), [&threadData](int desc) {
-        /* the client descriptor becomes ready */
-        dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
-      },
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(2).size(), [&threadData](int desc) {
+         /* the client descriptor becomes ready */
+         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
+       }},
       /* client closes the connection */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0},
       /* closing the backend connection */
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done, 0 },
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done, 0},
       /* closing the client connection */
-      { ExpectedStep::ExpectedRequest::closeClient, IOState::Done, 0 },
+      {ExpectedStep::ExpectedRequest::closeClient, IOState::Done, 0},
     };
 
     s_processQuery = [proxyEnabledBackend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
@@ -3726,39 +3727,39 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
     appendPayloadEditingID(expectedBackendWriteBuffer, queries.at(2), 2);
 
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
       /* reading a query from the client (1) */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(0).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(0).size() - 2},
       /* opening a connection to the backend */
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
       /* sending query (1) to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, proxyPayload.size() + queries.at(0).size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, proxyPayload.size() + queries.at(0).size()},
       /* we try to read the response, not ready yet */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0},
       /* reading a second query from the client */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(1).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(1).size() - 2},
       /* sending query (2) to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(1).size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(1).size()},
       /* backend is not ready yet */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0},
       /* reading a third query from the client */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(2).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(2).size() - 2},
       /* sending query (3) to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(2).size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(2).size()},
       /* backend is not ready yet, but the descriptor becomes ready */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0, [&threadData](int desc) {
-        /* the backend descriptor becomes ready */
-        dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
-      }},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0, [&threadData](int desc) {
+         /* the backend descriptor becomes ready */
+         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
+       }},
       /* client closes the connection */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0},
       /* closing the backend connection */
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done, 0 },
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done, 0},
       /* closing the client connection */
-      { ExpectedStep::ExpectedRequest::closeClient, IOState::Done, 0 },
+      {ExpectedStep::ExpectedRequest::closeClient, IOState::Done, 0},
     };
 
     s_processQuery = [proxyEnabledBackend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
@@ -3808,29 +3809,29 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
 
     bool timeout = false;
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
       /* reading a query from the client (1) */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(0).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(0).size() - 2},
       /* opening a connection to the backend */
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
       /* backend is not ready yet */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::NeedWrite, 0 },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::NeedWrite, 0},
       /* reading a second query from the client */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(1).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(1).size() - 2},
       /* 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;
-      },
+      {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 */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0},
       /* closing the client connection */
-      { ExpectedStep::ExpectedRequest::closeClient, IOState::Done, 0 },
+      {ExpectedStep::ExpectedRequest::closeClient, IOState::Done, 0},
       /* closing the backend connection */
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done, 0 },
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done, 0},
     };
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
@@ -3918,130 +3919,130 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
     int backend2Desc = -1;
 
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
       /* reading a query from the client (1) */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(0).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(0).size() - 2},
       /* opening a connection to the backend (1) */
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [&backend1Desc](int desc) {
-        backend1Desc = desc;
-      },
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [&backend1Desc](int desc) {
+         backend1Desc = desc;
+       }},
       /* sending query (1) to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(0).size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(0).size()},
       /* no response ready yet */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0},
       /* reading a query from the client (2) */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(1).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(1).size() - 2},
       /* sending query (2) to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(1).size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(1).size()},
       /* no response ready yet */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0},
       /* reading a query from the client (3) */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(2).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(2).size() - 2},
       /* opening a connection to the SECOND backend (2) */
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [&backend2Desc](int desc) {
-        backend2Desc = desc;
-      },
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [&backend2Desc](int desc) {
+         backend2Desc = desc;
+       }},
       /* sending query (3) to backend 2 */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(2).size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(2).size()},
       /* no response ready yet */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0},
       /* reading a query from the client (4) */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(3).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(3).size() - 2},
       /* sending query to the second backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(3).size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(3).size()},
       /* no response ready yet */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+      {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);
-      },
+      {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);
+       }},
       /* reading response (1) from the first backend (1) */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+      {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,&backend1Desc](int desc) {
-        /* client becomes readable */
-        dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
-        /* first backend is no longer readable */
-        dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(backend1Desc);
-      },
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(0).size(), [&threadData, &backend1Desc](int desc) {
+         /* client becomes readable */
+         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
+         /* first backend is no longer readable */
+         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(backend1Desc);
+       }},
       /* no response ready from the backend yet */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0},
       /* reading a query from the client (5) */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(4).size() - 2, [&threadData](int desc) {
-        /* client is not ready anymore */
-        dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
-      }  },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(4).size() - 2, [&threadData](int desc) {
+         /* client is not ready anymore */
+         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
+       }},
       /* sending query (5) to the first backend (1) */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(4).size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(4).size()},
       /* no response ready yet, but the first backend becomes ready */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0, [&threadData](int desc) {
-        /* set the outgoing descriptor (backend connection) as ready */
-        dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
-      },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0, [&threadData](int desc) {
+         /* set the outgoing descriptor (backend connection) as ready */
+         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
+       }},
       /* trying to read from client, nothing yet */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0},
       /* reading response (2) from the first backend (1) */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(1).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+      {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,&backend1Desc,&backend2Desc](int desc) {
-        /* client is NOT readable, backend1 is not readable, backend 2 becomes readable */
-        dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
-        dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(backend1Desc);
-        dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(backend2Desc);
-      },
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(1).size(), [&threadData, &backend1Desc, &backend2Desc](int desc) {
+         /* client is NOT readable, backend1 is not readable, backend 2 becomes readable */
+         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
+         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(backend1Desc);
+         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(backend2Desc);
+       }},
       /* no more response ready yet from backend 1 */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0},
       /* reading response (3) from the second backend (2) */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(2).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+      {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);
-      },
+      {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);
+       }},
       /* no more response ready yet from backend 2 */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0},
       /* reading response (5) from the first backend (1) */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(4).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+      {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);
-      },
+      {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);
+       }},
       /* no more response ready yet from backend 1 */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0},
       /* reading response (4) from the second backend (2) */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(3).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+      {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 */
-        dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(-1);
-      },
+      {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 */
+         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(-1);
+       }},
       /* client closes the connection */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0},
       /* closing client connection */
-      { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeClient, IOState::Done},
       /* closing a connection to the backends */
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
     };
 
     s_processQuery = [backend1](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
@@ -4091,47 +4092,47 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR, TestFixture)
 
     bool timeout = false;
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
       /* reading a query from the client (1) */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(0).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(0).size() - 2},
       /* opening a connection to the backend */
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
       /* sending query to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(0).size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(0).size()},
       /* no response ready yet */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0},
       /* reading a query from the client (2) */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(1).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(1).size() - 2},
       /* sending query to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(1).size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(1).size()},
       /* no response ready yet, but mark the descriptor as ready */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0, [&threadData](int desc) {
-        dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
-      },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0, [&threadData](int desc) {
+         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
+       }},
       /* nothing more from the client either */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0},
 
       /* reading response (1) from the backend */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size() - 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size()},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size() - 2},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size()},
       /* sending it to the client */
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(0).size()},
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(0).size()},
       /* reading response (2) from the backend */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size() - 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size(), [&threadData](int desc) {
-        dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
-      },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size() - 2},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size(), [&threadData](int desc) {
+         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
+       }},
       /* 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;
-      },
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(0).size(), [&timeout](int desc) {
+         (void)desc;
+         timeout = true;
+       }},
       /* closing a connection to the backend */
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
       /* closing client connection */
-      { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeClient, IOState::Done},
     };
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
@@ -4206,7 +4207,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendNotOOOR, TestFixture)
     pwQ.getHeader()->rd = 1;
     pwQ.getHeader()->id = counter;
     uint16_t querySize = static_cast<uint16_t>(query.size());
-    const uint8_t sizeBytes[] = { static_cast<uint8_t>(querySize / 256), static_cast<uint8_t>(querySize % 256) };
+    const uint8_t sizeBytes[] = {static_cast<uint8_t>(querySize / 256), static_cast<uint8_t>(querySize % 256)};
     query.insert(query.begin(), sizeBytes, sizeBytes + 2);
     totalQueriesSize += query.size();
     ++counter;
@@ -4226,7 +4227,7 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendNotOOOR, TestFixture)
     pwR.commit();
 
     uint16_t responseSize = static_cast<uint16_t>(response.size());
-    const uint8_t sizeBytes[] = { static_cast<uint8_t>(responseSize / 256), static_cast<uint8_t>(responseSize % 256) };
+    const uint8_t sizeBytes[] = {static_cast<uint8_t>(responseSize / 256), static_cast<uint8_t>(responseSize % 256)};
     response.insert(response.begin(), sizeBytes, sizeBytes + 2);
     totalResponsesSize += response.size();
     ++counter;
@@ -4259,122 +4260,122 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendNotOOOR, TestFixture)
     expectedWriteBuffer.insert(expectedWriteBuffer.end(), responses.at(4).begin(), responses.at(4).end());
     expectedWriteBuffer.insert(expectedWriteBuffer.end(), responses.at(3).begin(), responses.at(3).end());
 
-    std::vector<int> backendDescriptors = { -1, -1, -1, -1, -1 };
+    std::vector<int> backendDescriptors = {-1, -1, -1, -1, -1};
 
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
       /* reading a query from the client (1) */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(0).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(0).size() - 2},
       /* opening a connection to the backend (1) */
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [&backendDescriptors](int desc) {
-        backendDescriptors.at(0) = desc;
-      },
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [&backendDescriptors](int desc) {
+         backendDescriptors.at(0) = desc;
+       }},
       /* sending query (1) to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(0).size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(0).size()},
       /* no response ready yet */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0},
       /* reading a query from the client (2) */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(1).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(1).size() - 2},
       /* opening a connection to the backend (2) */
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [&backendDescriptors](int desc) {
-        backendDescriptors.at(1) = desc;
-      },
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [&backendDescriptors](int desc) {
+         backendDescriptors.at(1) = desc;
+       }},
       /* sending query (2) to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(1).size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(1).size()},
       /* no response ready yet */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0},
       /* reading a query from the client (3) */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(2).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(2).size() - 2},
       /* opening a connection to the backend (3) */
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [&backendDescriptors](int desc) {
-        backendDescriptors.at(2) = desc;
-      },
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [&backendDescriptors](int desc) {
+         backendDescriptors.at(2) = desc;
+       }},
       /* sending query (3) to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(2).size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(2).size()},
       /* no response ready yet */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0},
       /* reading a query from the client (4) */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(3).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(3).size() - 2},
       /* opening a connection to the backend (4) */
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [&backendDescriptors](int desc) {
-        backendDescriptors.at(3) = desc;
-      },
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [&backendDescriptors](int desc) {
+         backendDescriptors.at(3) = desc;
+       }},
       /* sending query (3) to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(3).size() },
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(3).size()},
       /* no response ready yet */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0},
       /* reading a query from the client (5) */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(4).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(4).size() - 2},
       /* opening a connection to the backend (5) */
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [&backendDescriptors](int desc) {
-        backendDescriptors.at(4) = desc;
-      },
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [&backendDescriptors](int desc) {
+         backendDescriptors.at(4) = desc;
+       }},
       /* sending query (5) to the backend */
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(4).size() },
+      {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));
-      },
+      {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 */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0 , [&threadData](int desc) {
-        dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
-      },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0, [&threadData](int desc) {
+         dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
+       }},
       /* reading response (1) from the first backend (1) */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+      {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));
-      },
+      {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) */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(2).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+      {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));
-      },
+      {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) */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(1).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+      {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));
-      },
+      {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) */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(4).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+      {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));
-      },
+      {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) */
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(3).size() - 2 },
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+      {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);
-      },
+      {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 */
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0 },
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0},
       /* closing client connection */
-      { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeClient, IOState::Done},
       /* closing a connection to the backends */
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
     };
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
@@ -4419,18 +4420,17 @@ BOOST_FIXTURE_TEST_CASE(test_IncomingConnectionOOOR_BackendNotOOOR, TestFixture)
     }
 
     bool timeout = false;
-    s_steps = { { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
-                { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-                { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(0).size() - 2 },
-                { 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) {
+    s_steps = {{ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
+               {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+               {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(0).size() - 2},
+               {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 */
-                { ExpectedStep::ExpectedRequest::closeClient, IOState::Done }
-    };
+               /* close the connection with the client */
+               {ExpectedStep::ExpectedRequest::closeClient, IOState::Done}};
 
     s_processQuery = [backend](DNSQuestion& dq, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
       selectedBackend = backend;
@@ -4488,7 +4488,7 @@ BOOST_FIXTURE_TEST_CASE(test_Pipelined_Queries_Immediate_Responses, TestFixture)
   pwQ.getHeader()->id = 0;
 
   auto querySize = static_cast<uint16_t>(query.size());
-  const std::array<uint8_t, 2> sizeBytes{ static_cast<uint8_t>(querySize / 256), static_cast<uint8_t>(querySize % 256) };
+  const std::array<uint8_t, 2> sizeBytes{static_cast<uint8_t>(querySize / 256), static_cast<uint8_t>(querySize % 256)};
   query.insert(query.begin(), sizeBytes.begin(), sizeBytes.end());
 
   auto backend = std::make_shared<DownstreamState>(getBackendAddress("42", 53));
@@ -4502,15 +4502,15 @@ BOOST_FIXTURE_TEST_CASE(test_Pipelined_Queries_Immediate_Responses, TestFixture)
     s_backendReadBuffer = query;
 
     s_steps = {
-      { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
+      {ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2},
       /* opening a connection to the backend */
-      { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
-      { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
-      { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, query.size() - 2 },
-      { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, query.size() },
+      {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+      {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size()},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2},
+      {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, query.size() - 2},
+      {ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, query.size()},
     };
     for (size_t idx = 1; idx < nbQueries; idx++) {
       appendPayloadEditingID(s_readBuffer, query, idx);
index dfa7a34e03b3710ebba69ba1f4ce4bfb87f44539..4dced403ec4d563a9b5a723c9d4d72abea9bc651 100644 (file)
@@ -40,4 +40,3 @@ int main(int argc, char* argv[])
   setenv("BOOST_TEST_RANDOM", "1", 1); // NOLINT(concurrency-mt-unsafe)
   return boost::unit_test::unit_test_main(&init_unit_test, argc, argv);
 }
-