From: Remi Gacogne Date: Thu, 20 Mar 2025 12:35:21 +0000 (+0100) Subject: dnsdist: Apply suggestions from Miod's review X-Git-Tag: dnsdist-2.0.0-alpha2~132^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F15330%2Fhead;p=thirdparty%2Fpdns.git dnsdist: Apply suggestions from Miod's review --- diff --git a/pdns/dnsdistdist/dnsdist-configuration-yaml.cc b/pdns/dnsdistdist/dnsdist-configuration-yaml.cc index f4cc0fd13b..00d2c5aa1d 100644 --- a/pdns/dnsdistdist/dnsdist-configuration-yaml.cc +++ b/pdns/dnsdistdist/dnsdist-configuration-yaml.cc @@ -1385,7 +1385,7 @@ std::shared_ptr getKeyValueStoreLookupAction([[maybe_unused]] auto action = dnsdist::actions::getKeyValueStoreLookupAction(kvs, lookupKey, std::string(config.destination_tag)); return newDNSActionWrapper(std::move(action), config.name); #else - throw std::runtime_error("Unable to create KVS action: neitherCDB nor LMDB support are enabled"); + throw std::runtime_error("Unable to create KVS action: neither CDB nor LMDB support are enabled"); #endif } @@ -1403,7 +1403,7 @@ std::shared_ptr getKeyValueStoreRangeLookupAction([[maybe_unus auto action = dnsdist::actions::getKeyValueStoreRangeLookupAction(kvs, lookupKey, std::string(config.destination_tag)); return newDNSActionWrapper(std::move(action), config.name); #else - throw std::runtime_error("Unable to create KVS action: neitherCDB nor LMDB support are enabled"); + throw std::runtime_error("Unable to create KVS action: neither CDB nor LMDB support are enabled"); #endif } @@ -1421,7 +1421,7 @@ std::shared_ptr getKeyValueStoreLookupSelector([[maybe_unused]] con auto selector = dnsdist::selectors::getKeyValueStoreLookupSelector(kvs, lookupKey); return newDNSSelector(std::move(selector), config.name); #else - throw std::runtime_error("Unable to create KVS action: neitherCDB nor LMDB support are enabled"); + throw std::runtime_error("Unable to create KVS action: neither CDB nor LMDB support are enabled"); #endif } @@ -1439,7 +1439,7 @@ std::shared_ptr getKeyValueStoreRangeLookupSelector([[maybe_unused] auto selector = dnsdist::selectors::getKeyValueStoreRangeLookupSelector(kvs, lookupKey); return newDNSSelector(std::move(selector), config.name); #else - throw std::runtime_error("Unable to create KVS action: neitherCDB nor LMDB support are enabled"); + throw std::runtime_error("Unable to create KVS action: neither CDB nor LMDB support are enabled"); #endif } @@ -1624,7 +1624,6 @@ void registerKVSObjects([[maybe_unused]] const KeyValueStoresConfiguration& conf { #if defined(HAVE_LMDB) || defined(HAVE_CDB) bool createObjects = !dnsdist::configuration::yaml::s_inClientMode && !dnsdist::configuration::yaml::s_inConfigCheckMode; -#endif /* defined(HAVE_LMDB) || defined(HAVE_CDB) */ #if defined(HAVE_LMDB) for (const auto& lmdb : config.lmdb) { auto store = createObjects ? std::shared_ptr(std::make_shared(std::string(lmdb.file_name), std::string(lmdb.database_name), lmdb.no_lock)) : std::shared_ptr(); @@ -1637,7 +1636,6 @@ void registerKVSObjects([[maybe_unused]] const KeyValueStoresConfiguration& conf dnsdist::configuration::yaml::registerType(store, cdb.name); } #endif /* defined(HAVE_CDB) */ -#if defined(HAVE_LMDB) || defined(HAVE_CDB) for (const auto& key : config.lookup_keys.source_ip_keys) { auto lookup = createObjects ? std::shared_ptr(std::make_shared(key.v4_mask, key.v6_mask, key.include_port)) : std::shared_ptr(); dnsdist::configuration::yaml::registerType(lookup, key.name);