mirror of
https://github.com/sogou/workflow.git
synced 2026-10-21 22:56:42 +08:00
remove a public class in DNS_cache
This commit is contained in:
+10
-9
@@ -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_;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user