remove a public class in DNS_cache

This commit is contained in:
XieHan
2021-06-03 01:19:47 +08:00
parent f4c01ec327
commit 7175807495
+10 -9
View File
@@ -38,15 +38,6 @@ struct DNSCacheValue
int64_t expire_time;
};
class ValueDeleter
{
public:
void operator() (const DNSCacheValue& value) const
{
freeaddrinfo(value.addrinfo);
}
};
// RAII: NO. Release handle by user
// Thread safety: YES
// MUST call release when handle no longer used
@@ -159,6 +150,16 @@ private:
const DNSHandle *get_inner(const HostPort& host_port, int type);
std::mutex mutex_;
class ValueDeleter
{
public:
void operator() (const DNSCacheValue& value) const
{
freeaddrinfo(value.addrinfo);
}
};
LRUCache<HostPort, DNSCacheValue, ValueDeleter> cache_pool_;
};