From: Ruben d'Arco Date: Thu, 4 Jun 2015 11:20:19 +0000 (+0200) Subject: It compiles. X-Git-Tag: dnsdist-1.0.0-alpha1~248^2~58^2~21^2~5^2~59 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fdc3e27b40542cbd1dc1c21e3c4218ed284f30f5;p=thirdparty%2Fpdns.git It compiles. --- diff --git a/pdns/dnsname.cc b/pdns/dnsname.cc index 329fa58de4..b13c899d31 100644 --- a/pdns/dnsname.cc +++ b/pdns/dnsname.cc @@ -89,6 +89,10 @@ std::string DNSName::toDNSString() const return ret; } +const char* DNSName::toCString() const { + return this->toString().c_str(); +} + // are WE part of parent bool DNSName::isPartOf(const DNSName& parent) const { diff --git a/pdns/dnsname.hh b/pdns/dnsname.hh index af243d33b5..3939fa9e09 100644 --- a/pdns/dnsname.hh +++ b/pdns/dnsname.hh @@ -37,6 +37,7 @@ 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/packetcache.cc b/pdns/packetcache.cc index ced4b0e213..12cf7fe28d 100644 --- a/pdns/packetcache.cc +++ b/pdns/packetcache.cc @@ -229,7 +229,7 @@ int PacketCache::purge(const string &match) cmap_t::const_iterator start=iter; for(; iter != mc.d_map.end(); ++iter) { - if(iter->qname.compare(0, zone.size(), zone) != 0) { + if(iter->qname.toString().compare(0, zone.size(), zone) != 0) { //TODO: check if there is a nicer method for this break; } delcount++; diff --git a/pdns/packetcache.hh b/pdns/packetcache.hh index 3b4e936dba..fb8666c50e 100644 --- a/pdns/packetcache.hh +++ b/pdns/packetcache.hh @@ -98,7 +98,7 @@ private: ordered_unique< composite_key< CacheEntry, - member, + member, member, member, member, @@ -107,7 +107,7 @@ private: member, member >, - composite_key_compare, std::less, std::less, std::less, std::less, + composite_key_compare, std::less, std::less, std::less, std::less, std::less, std::less, std::less > >, sequenced<> @@ -122,9 +122,9 @@ private: }; vector d_maps; - MapCombo& getMap(const std::string& qname) + MapCombo& getMap(const DNSName& qname) { - return d_maps[burtle((const unsigned char*)qname.c_str(), qname.length(), 0) % d_maps.size()]; + return d_maps[burtle((const unsigned char*)qname.toCString(), qname.toString().length(), 0) % d_maps.size()]; }