Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
net: report completed when context is done in cgoLookupIP and cgoLook…
…upPTR All the Lookup* methods that resolve hostnames eventually call lookupIP or lookupHost method. When the order is selected to be hostLookupCGO then lookupHost calls cgoLookupHost which internally calls cgoLookupIP (the lookupIP directly calls cgoLookupIP). When we provide a context that is cancelled after cgo call, then the cgoLookupIP returns completed == false, which caues the lookupIP/lookupHost to fallback to the go resolver. This fallback is unnecessary because our context is already cancelled. The same thing can happen to LookupAddr. Change-Id: Ifff7716c461f05d954ef43b5205865103558b410 GitHub-Last-Rev: 2ef2023e8c51cdd251986f79e94aba86a0722230 GitHub-Pull-Request: golang/go#57042 Reviewed-on: https://go-review.googlesource.com/c/go/+/454696 TryBot-Result: Gopher Robot <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> Reviewed-by: Damien Neil <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
- Loading branch information