tls-autodetect: avoid a goroutine leak on timeout

This commit is contained in:
2018-07-23 05:33:50 +02:00
parent a8f02e0d37
commit e8602ee718

View File

@@ -322,7 +322,7 @@ func prepare(client *client) {
// The Cgo resolver doesn't pthread_cancel getnameinfo threads, so not
// bothering with pointless contexts.
ch := make(chan string)
ch := make(chan string, 1)
go func() {
defer close(ch)
if names, err := net.LookupAddr(host); err != nil {