From: Ruben d'Arco Date: Fri, 5 Jun 2015 08:46:12 +0000 (+0200) Subject: Re-add cerr's and change error message slightly to identify better X-Git-Tag: dnsdist-1.0.0-alpha1~248^2~58^2~21^2~5^2~53 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e11dc8c88d987f2e5462a1626f2adab7925aa6c2;p=thirdparty%2Fpdns.git Re-add cerr's and change error message slightly to identify better --- diff --git a/pdns/dnsname.cc b/pdns/dnsname.cc index 3b290c6de4..970a69ae29 100644 --- a/pdns/dnsname.cc +++ b/pdns/dnsname.cc @@ -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()); diff --git a/pdns/dnspacket.cc b/pdns/dnspacket.cc index 9082c2866c..f09b361451 100644 --- a/pdns/dnspacket.cc +++ b/pdns/dnspacket.cc @@ -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=["<::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"< parts = name.getRawLabels(); // labelparts_t parts; - //cerr<<"labelcount: "<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 = "<