From: Ruben d'Arco Date: Fri, 5 Jun 2015 09:38:57 +0000 (+0200) Subject: more stuff :) X-Git-Tag: dnsdist-1.0.0-alpha1~248^2~58^2~21^2~5^2~51 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=13f614e94a919bc2047c8741860faa860c84e05e;p=pdns more stuff :) --- diff --git a/pdns/dnsname.cc b/pdns/dnsname.cc index 970a69ae2..a926b7c13 100644 --- a/pdns/dnsname.cc +++ b/pdns/dnsname.cc @@ -89,10 +89,6 @@ std::string DNSName::toDNSString() const return ret; } -const char* DNSName::toCString() const { - return this->toString().c_str(); -} - size_t DNSName::length() const { return this->toString().length(); } diff --git a/pdns/dnsname.hh b/pdns/dnsname.hh index a4feb6df2..da3effe8c 100644 --- a/pdns/dnsname.hh +++ b/pdns/dnsname.hh @@ -37,7 +37,6 @@ public: std::string toString() const; //!< Our human-friendly, escaped, representation std::string toDNSString() const; //!< Our representation in DNS native format - const char* toCString() const; //!< Easy access to toString().c_str(); void appendRawLabel(const std::string& str); //!< Append this unescaped label void prependRawLabel(const std::string& str); //!< Prepend this unescaped label std::vector getRawLabels() const; //!< Individual raw unescaped labels diff --git a/pdns/dnspacket.cc b/pdns/dnspacket.cc index f09b36145..6ba951c8e 100644 --- a/pdns/dnspacket.cc +++ b/pdns/dnspacket.cc @@ -303,7 +303,7 @@ void DNSPacket::wrapup() try { uint8_t maxScopeMask=0; for(pos=d_rrs.begin(); pos < d_rrs.end(); ++pos) { -// cerr<<"during wrapup, content=["<content<<"]"<content<<"]"<scopeMask); if(!pos->content.empty() && pos->qtype.getCode()==QType::TXT && pos->content[0]!='"') { diff --git a/pdns/packetcache.cc b/pdns/packetcache.cc index 12cf7fe28..62bf0e260 100644 --- a/pdns/packetcache.cc +++ b/pdns/packetcache.cc @@ -229,10 +229,10 @@ int PacketCache::purge(const string &match) cmap_t::const_iterator start=iter; for(; iter != mc.d_map.end(); ++iter) { - if(iter->qname.toString().compare(0, zone.size(), zone) != 0) { //TODO: check if there is a nicer method for this - break; - } - delcount++; + if(iter->qname.toString().compare(0, zone.size(), zone) != 0) { //TODO: check if there is a nicer method for this + break; + } + delcount++; } mc.d_map.erase(start, iter); } diff --git a/pdns/packetcache.hh b/pdns/packetcache.hh index fb8666c50..6177e8007 100644 --- a/pdns/packetcache.hh +++ b/pdns/packetcache.hh @@ -124,7 +124,7 @@ private: vector d_maps; MapCombo& getMap(const DNSName& qname) { - return d_maps[burtle((const unsigned char*)qname.toCString(), qname.toString().length(), 0) % d_maps.size()]; + return d_maps[burtle((const unsigned char*)qname.toString().c_str(), qname.toString().length(), 0) % d_maps.size()]; }