0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 18:22:50 +01:00

ircd::net: Underp the cache map until heterogeneous key support in stdlib.

This commit is contained in:
Jason Volk 2018-03-06 04:03:31 -08:00
parent 7021250cc3
commit 2ec4bd025f
2 changed files with 3 additions and 6 deletions

View file

@ -85,11 +85,8 @@ struct ircd::net::dns::opts
/// (internal) DNS cache /// (internal) DNS cache
struct ircd::net::dns::cache struct ircd::net::dns::cache
{ {
using hash = std::hash<string_view>; std::multimap<std::string, rfc1035::record::A, std::less<>> A;
using equal_to = std::equal_to<string_view>; std::multimap<std::string, rfc1035::record::SRV, std::less<>> SRV;
std::unordered_multimap<std::string, rfc1035::record::A, hash, equal_to> A;
std::unordered_multimap<std::string, rfc1035::record::SRV, hash, equal_to> SRV;
}; };
template<class Callback> template<class Callback>

View file

@ -2293,7 +2293,7 @@ ircd::net::dns::query_cache(const hostport &hp,
}; };
auto &map{cache.SRV}; auto &map{cache.SRV};
const auto pit{map.equal_range(std::string{srvhost})}; //TODO: XXX const auto pit{map.equal_range(srvhost)};
if(pit.first == pit.second) if(pit.first == pit.second)
return false; return false;