fix: resolver's ctx
This commit is contained in:
parent
4ea4221380
commit
7c1b878c3f
1 changed files with 0 additions and 4 deletions
|
@ -70,8 +70,6 @@ func LookupIPv4WithResolver(ctx context.Context, host string, r Resolver) ([]net
|
||||||
return DefaultResolver.LookupIPv4(ctx, host)
|
return DefaultResolver.LookupIPv4(ctx, host)
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), DefaultDNSTimeout)
|
|
||||||
defer cancel()
|
|
||||||
ipAddrs, err := net.DefaultResolver.LookupNetIP(ctx, "ip4", host)
|
ipAddrs, err := net.DefaultResolver.LookupNetIP(ctx, "ip4", host)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -129,8 +127,6 @@ func LookupIPv6WithResolver(ctx context.Context, host string, r Resolver) ([]net
|
||||||
return DefaultResolver.LookupIPv6(ctx, host)
|
return DefaultResolver.LookupIPv6(ctx, host)
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), DefaultDNSTimeout)
|
|
||||||
defer cancel()
|
|
||||||
ipAddrs, err := net.DefaultResolver.LookupNetIP(ctx, "ip6", host)
|
ipAddrs, err := net.DefaultResolver.LookupNetIP(ctx, "ip6", host)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Reference in a new issue