IXDNSLookup. Uses weak pointer + smart_ptr + shared_from_this instead of static sets + mutex to handle object going away before dns lookup has resolved
This commit is contained in:
@ -128,8 +128,8 @@ namespace ix
|
||||
//
|
||||
// First do DNS resolution
|
||||
//
|
||||
DNSLookup dnsLookup(hostname, port);
|
||||
struct addrinfo *res = dnsLookup.resolve(errMsg, isCancellationRequested);
|
||||
auto dnsLookup = std::make_shared<DNSLookup>(hostname, port);
|
||||
struct addrinfo *res = dnsLookup->resolve(errMsg, isCancellationRequested);
|
||||
if (res == nullptr)
|
||||
{
|
||||
return -1;
|
||||
|
Reference in New Issue
Block a user