0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-07-04 17:48:35 +02: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
struct ircd::net::dns::cache
{
using hash = std::hash<string_view>;
using equal_to = std::equal_to<string_view>;
std::unordered_multimap<std::string, rfc1035::record::A, hash, equal_to> A;
std::unordered_multimap<std::string, rfc1035::record::SRV, hash, equal_to> SRV;
std::multimap<std::string, rfc1035::record::A, std::less<>> A;
std::multimap<std::string, rfc1035::record::SRV, std::less<>> SRV;
};
template<class Callback>

View file

@ -2293,7 +2293,7 @@ ircd::net::dns::query_cache(const hostport &hp,
};
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)
return false;