From 28f925b626cb352b6c7913ad4056522c1c0fc51d Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Thu, 20 Mar 2025 13:35:21 +0100 Subject: [PATCH] dnsdist: Apply suggestions from Miod's review --- pdns/dnsdistdist/dnsdist-configuration-yaml.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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); -- 2.47.2