]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Make the frontend code dedup clearer 7934/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 17 Jun 2019 13:46:57 +0000 (15:46 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 17 Jun 2019 13:46:57 +0000 (15:46 +0200)
pdns/dnsdist-carbon.cc
pdns/dnsdist-web.cc

index b0b2997c2a8d6b139a720e0e5920d1b13505caee..e3fc46fa176dc517dc760d0bf6411df6da9f1373 100644 (file)
@@ -113,9 +113,9 @@ try
           string frontName = front->local.toString() + ":" + std::to_string(front->local.getPort()) +  (front->udpFD >= 0 ? "_udp" : "_tcp");
           boost::replace_all(frontName, ".", "_");
           auto dupPair = frontendDuplicates.insert({frontName, 1});
-          if (dupPair.second == false) {
+          if (!dupPair.second) {
             frontName = frontName + "_" + std::to_string(dupPair.first->second);
-            ++dupPair.first->second;
+            ++(dupPair.first->second);
           }
 
           const string base = namespace_name + "." + hostname + "." + instance_name + ".frontends." + frontName + ".";
@@ -167,9 +167,9 @@ try
             boost::replace_all(name, "]", "_");
 
             auto dupPair = dohFrontendDuplicates.insert({name, 1});
-            if (dupPair.second == false) {
+            if (!dupPair.second) {
               name = name + "_" + std::to_string(dupPair.first->second);
-              ++dupPair.first->second;
+              ++(dupPair.first->second);
             }
 
             vector<pair<const char*, const std::atomic<uint64_t>&>> v{
index f0ff9602cf05f499125a47ba2925d35ef883283b..a31c1a924ae5714739744472dc048754567ce0cd 100644 (file)
@@ -532,9 +532,9 @@ static void connectionThread(int sock, ComboAddress remote)
           string proto = (front->udpFD >= 0 ? "udp" : "tcp");
           string fullName = frontName + "_" + proto;
           auto dupPair = frontendDuplicates.insert({fullName, 1});
-          if (dupPair.second == false) {
+          if (!dupPair.second) {
             frontName = frontName + "_" + std::to_string(dupPair.first->second);
-            ++dupPair.first->second;
+            ++(dupPair.first->second);
           }
 
           output << "dnsdist_frontend_queries{frontend=\"" << frontName << "\",proto=\"" << proto