]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Replace rcode with RCode::to_s(rcode)
authorAki Tuomi <cmouse@desteem.org>
Thu, 20 Feb 2014 06:19:21 +0000 (08:19 +0200)
committerAki Tuomi <cmouse@desteem.org>
Thu, 20 Feb 2014 06:19:21 +0000 (08:19 +0200)
pdns/dnspacket.cc
pdns/mastercommunicator.cc
pdns/notify.cc
pdns/resolver.cc
pdns/syncres.cc

index 88e831f159acf6b5682f85307e25c103072ad4b9..7dcefd9e92ceac6c91f76afda1824d8a33b344f0 100644 (file)
@@ -544,7 +544,7 @@ try
 
   if(!ntohs(d.qdcount)) {
     if(!d_tcp) {
-      L << Logger::Warning << "No question section in packet from " << getRemote() <<", rcode="<<(int)d.rcode<<endl;
+      L << Logger::Warning << "No question section in packet from " << getRemote() <<", error="<<RCode::to_s(d.rcode)<<endl;
       return -1;
     }
   }
index 1d88c58f898cd4529233c7ad0c7a357f7e534894..8da8dade3a8aaa1f45b599cb1f89d9e823e44dbe 100644 (file)
@@ -175,10 +175,10 @@ time_t CommunicatorClass::doNotifications()
     }
 
     if(p.d.rcode)
-      L<<Logger::Warning<<"Received unsuccessful notification report for '"<<p.qdomain<<"' from "<<from.toStringWithPort()<<", rcode: "<<p.d.rcode<<endl;      
+      L<<Logger::Warning<<"Received unsuccessful notification report for '"<<p.qdomain<<"' from "<<from.toStringWithPort()<<", error: "<<RCode::to_s(p.d.rcode)<<endl;      
 
     if(d_nq.removeIf(from.toStringWithPort(), p.d.id, p.qdomain))
-      L<<Logger::Warning<<"Removed from notification list: '"<<p.qdomain<<"' to "<<from.toStringWithPort()<< (p.d.rcode ? "" : " (was acknowledged)")<<endl;      
+      L<<Logger::Warning<<"Removed from notification list: '"<<p.qdomain<<"' to "<<from.toStringWithPort()<< (p.d.rcode ? RCode::to_s(p.d.rcode) : " (was acknowledged)")<<endl;      
     else {
       L<<Logger::Warning<<"Received spurious notify answer for '"<<p.qdomain<<"' from "<< from.toStringWithPort()<<endl;
       //d_nq.dump();
index 1d3b85ed5ad4a9cb3a77654f902b9ded48a56c0c..acb60c05ad9a247b88b87eac8204df02adaf6085 100644 (file)
@@ -61,7 +61,7 @@ try
   string packet(buffer, len);
   MOADNSParser mdp(packet);
 
-  cerr<<"Received notification response with code: "<<mdp.d_header.rcode<<endl;
+  cerr<<"Received notification response with error: "<<RCode::to_s(mdp.d_header.rcode)<<endl;
   cerr<<"For: '"<<mdp.d_qname<<"'"<<endl;
 }
 catch(std::exception& e)
index 92b0656ecddf866b5eff5fdd43c97f2c2d3973d4..d0357167bbe2b121ec88bd28cb4db63b748eb976 100644 (file)
@@ -277,7 +277,7 @@ bool Resolver::tryGetSOASerial(string* domain, uint32_t *theirSerial, uint32_t *
   *domain = stripDot(mdp.d_qname);
   
   if(mdp.d_answers.empty())
-    throw ResolverException("Query to '" + fromaddr.toStringWithPort() + "' for SOA of '" + *domain + "' produced no results (error code: "+strrcode(mdp.d_header.rcode)+")");
+    throw ResolverException("Query to '" + fromaddr.toStringWithPort() + "' for SOA of '" + *domain + "' produced no results (RCode: " + RCode::to_s(mdp.d_header.rcode) + ")");
   
   if(mdp.d_qtype != QType::SOA)
     throw ResolverException("Query to '" + fromaddr.toStringWithPort() + "' for SOA of '" + *domain + "' returned wrong record type");
@@ -467,7 +467,7 @@ int AXFRRetriever::getChunk(Resolver::res_t &res) // Implementation is making su
 
   int err = parseResult(mdp, "", 0, 0, &res);
   if(err) 
-    throw ResolverException("AXFR chunk with a non-zero rcode "+lexical_cast<string>(err));
+    throw ResolverException("AXFR chunk error: " + RCode::to_s(err));
 
   BOOST_FOREACH(const MOADNSParser::answers_t::value_type& answer, mdp.d_answers)
     if (answer.first.d_type == QType::SOA)
index 1b94a83d88dac6135f1b06c6251c23eec3f23eb9..ac13d4df707d6e1afc9f439f8aa804884dfc15c8 100644 (file)
@@ -981,7 +981,7 @@ int SyncRes::doResolveAt(set<string, CIStringCompare> nameservers, string auth,
           return RCode::ServFail;
         }
         
-        LOG(prefix<<qname<<": Got "<<(unsigned int)lwr.d_result.size()<<" answers from "<<*tns<<" ("<< remoteIP->toString() <<"), rcode="<<lwr.d_rcode<<", aa="<<lwr.d_aabit<<", in "<<lwr.d_usec/1000<<"ms"<<endl);
+        LOG(prefix<<qname<<": Got "<<(unsigned int)lwr.d_result.size()<<" answers from "<<*tns<<" ("<< remoteIP->toString() <<"), rcode="<<lwr.d_rcode<<" ("<<(RCode::to_s(lwr.d_rcode)<<"), aa="<<lwr.d_aabit<<", in "<<lwr.d_usec/1000<<"ms"<<endl);
 
         /*  // for you IPv6 fanatics :-)
         if(remoteIP->sin4.sin_family==AF_INET6)