From: Remi Gacogne Date: Mon, 31 Jul 2017 09:45:00 +0000 (+0200) Subject: dnsdist: Fix indentation X-Git-Tag: dnsdist-1.2.0~39^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5b8255bac44c095cc7c5d21d72478d366904418f;p=pdns dnsdist: Fix indentation --- diff --git a/pdns/dnsdist-lua.cc b/pdns/dnsdist-lua.cc index ee7c438fd..c3c58162f 100644 --- a/pdns/dnsdist-lua.cc +++ b/pdns/dnsdist-lua.cc @@ -1605,29 +1605,28 @@ vector> setupLua(bool client, const std::string& confi dq.qTag->add(tag.first, tag.second); } - }); - + }); g_lua.registerFunction("getTag", [](const DNSQuestion& dq, const std::string& strLabel) { - std::string strValue; - if(dq.qTag != nullptr) { - strValue = dq.qTag->getMatch(strLabel); - } - return strValue; + std::string strValue; + if(dq.qTag != nullptr) { + strValue = dq.qTag->getMatch(strLabel); + } + return strValue; - }); + }); g_lua.registerFunction(DNSQuestion::*)(void)>("getTagArray", [](const DNSQuestion& dq) { - if(dq.qTag != nullptr) { - return dq.qTag->tagData; - } else { - std::unordered_map XX; - return XX; - } - }); + if(dq.qTag != nullptr) { + return dq.qTag->tagData; + } else { + std::unordered_map XX; + return XX; + } + }); /* DNSQuestion bindings */ diff --git a/pdns/dnsdist.hh b/pdns/dnsdist.hh index 1763c060a..e92a72ecf 100644 --- a/pdns/dnsdist.hh +++ b/pdns/dnsdist.hh @@ -57,72 +57,67 @@ extern bool g_ECSOverride; class QTag { - public: + QTag() + { + } -QTag() -{ -} - -~QTag() -{ -} - -void add(const std::string strLabel, const std::string strValue) -{ - tagData.insert( {strLabel, strValue}); - return; -} + ~QTag() + { + } -std::string getMatch(const std::string& strLabel) const -{ - std::unordered_map::const_iterator got =tagData.find (strLabel); - if(got == tagData.end()) { - return ""; - } else { - return got->second; + void add(const std::string strLabel, const std::string strValue) + { + tagData.insert( {strLabel, strValue}); + return; } -} -std::string getEntry(size_t iEntry) const -{ - std::string strEntry; - size_t iCounter = 0; - - for (const auto& itr : tagData) { - iCounter++; - if(iCounter == iEntry) { - strEntry = itr.first; - strEntry += strSep; - strEntry += itr.second; - break; + std::string getMatch(const std::string& strLabel) const + { + std::unordered_map::const_iterator got =tagData.find (strLabel); + if(got == tagData.end()) { + return ""; + } else { + return got->second; } } - return strEntry; + std::string getEntry(size_t iEntry) const + { + std::string strEntry; + size_t iCounter = 0; + + for (const auto& itr : tagData) { + iCounter++; + if(iCounter == iEntry) { + strEntry = itr.first; + strEntry += strSep; + strEntry += itr.second; + break; + } + } -} + return strEntry; + } -size_t count() const -{ - return tagData.size(); -} + size_t count() const + { + return tagData.size(); + } -std::string dumpString() const -{ - std::string strRet; + std::string dumpString() const + { + std::string strRet; - for (const auto& itr : tagData) { - strRet += itr.first; - strRet += strSep; - strRet += itr.second; - strRet += "\n"; + for (const auto& itr : tagData) { + strRet += itr.first; + strRet += strSep; + strRet += itr.second; + strRet += "\n"; + } + return strRet; } - return strRet; -} - -public: std::unordered_maptagData; private: @@ -150,8 +145,7 @@ struct DNSQuestion const bool tcp; bool skipCache{false}; bool ecsOverride; - bool useECS{true}; - + bool useECS{true}; }; struct DNSResponse : DNSQuestion