]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Re-add cerr's and change error message slightly to identify better
authorRuben d'Arco <cyclops@prof-x.net>
Fri, 5 Jun 2015 08:46:12 +0000 (10:46 +0200)
committermind04 <mind04@monshouwer.org>
Tue, 30 Jun 2015 06:12:46 +0000 (08:12 +0200)
pdns/dnsname.cc
pdns/dnspacket.cc
pdns/dnswriter.cc

index 3b290c6de42b61ee522b1954c043b3b0f2fb8264..970a69ae29911ef3b4952923987dfe291ba578f7 100644 (file)
@@ -122,11 +122,11 @@ bool DNSName::isPartOf(const DNSName& parent) const
 void DNSName::appendRawLabel(const std::string& label)
 {
   if(label.empty())
-    throw std::range_error("no such thing as an empty label");
+    throw std::range_error("no such thing as an empty label to append");
   if(label.size() > 63)
-    throw std::range_error("label too long");
+    throw std::range_error("label too long to append");
   if(d_storage.size() + label.size() > 253) // reserve two bytes, one for length and one for the root label
-    throw std::range_error("name too long");
+    throw std::range_error("name too long to append");
 
   d_storage.append(1, (char)label.size());
   d_storage.append(label.c_str(), label.length());
@@ -135,11 +135,11 @@ void DNSName::appendRawLabel(const std::string& label)
 void DNSName::prependRawLabel(const std::string& label)
 {
   if(label.empty())
-    throw std::range_error("no such thing as an empty label");
+    throw std::range_error("no such thing as an empty label to prepend");
   if(label.size() > 63)
-    throw std::range_error("label too long");
+    throw std::range_error("label too long to prepend");
   if(d_storage.size() + label.size() > 253) // reserve two bytes, one for length and one for the root label
-    throw std::range_error("name too long");
+    throw std::range_error("name too long to prepend");
 
   string_t prep(1, (char)label.size());
   prep.append(label.c_str(), label.size());
index 9082c2866c63e9cc226d6450d4e3fbdbc5f03108..f09b361451947996864659156bb3e4814a0ed159 100644 (file)
@@ -167,13 +167,13 @@ void DNSPacket::addRecord(const DNSResourceRecord &rr)
 {
   // this removes duplicates from the packet in case we are not compressing
   // for AXFR, no such checking is performed!
-  //cerr<<"addrecord, content=["<<rr.content<<"]"<<endl;
+  cerr<<"addrecord, content=["<<rr.content<<"]"<<endl;
   if(d_compress)
     for(vector<DNSResourceRecord>::const_iterator i=d_rrs.begin();i!=d_rrs.end();++i) 
       if(rr.qname==i->qname && rr.qtype==i->qtype && rr.content==i->content) {
           return;
       }
-  //cerr<<"added to d_rrs"<<endl;
+  cerr<<"added to d_rrs"<<endl;
   d_rrs.push_back(rr);
 }
 
index 94557aec02c919661c5c736ce5737a5110ae8535..c9816db4e311d12ceb49546af00d587f9d6591d5 100644 (file)
@@ -200,10 +200,10 @@ void DNSPacketWriter::xfrName(const DNSName& name, bool compress)
 {
   // string label = d_lowerCase ? toLower(Label) : Label;
   // FIXME: we ignore d_lowerCase for now
-  //cerr<<"xfrName writing ["<<name.toString()<<"]"<<endl;
+  cerr<<"xfrName writing ["<<name.toString()<<"]"<<endl;
   std::vector<std::string> parts = name.getRawLabels();
   // labelparts_t parts;
-  //cerr<<"labelcount: "<<parts.size()<<endl;
+  cerr<<"labelcount: "<<parts.size()<<endl;
 
   if(d_canonic)
     compress=false;
@@ -223,7 +223,7 @@ void DNSPacketWriter::xfrName(const DNSName& name, bool compress)
   unsigned int startPos;
 
   for(auto &label: parts) {
-    //cerr<<"xfrName labelpart ["<<label<<"]"<<endl;
+    cerr<<"xfrName labelpart ["<<label<<"]"<<endl;
     // if(deDot)
     //   chopped.assign(label.c_str() + i->first, labellen - i->first -1);
     // else
@@ -267,7 +267,7 @@ void DNSPacketWriter::xfrName(const DNSName& name, bool compress)
     // }
     // else {
       char labelsize=label.size();
-      //cerr<<"labelsize = "<<int(labelsize)<<" for label ["<<label<<"]"<<endl;
+      cerr<<"labelsize = "<<int(labelsize)<<" for label ["<<label<<"]"<<endl;
       d_record.push_back(labelsize);
       unsigned int len=d_record.size();
       d_record.resize(len + labelsize);