mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 00:34:24 -04:00
plugin/forward: close channels when connManager returns (#1727)
Close a bunch of channels, also change the test to just use a for loop with a counter.
This commit is contained in:
@@ -44,7 +44,14 @@ func newTransport(addr string, tlsConfig *tls.Config) *transport {
|
||||
ret: make(chan connErr),
|
||||
stop: make(chan bool),
|
||||
}
|
||||
go t.connManager()
|
||||
go func() {
|
||||
t.connManager()
|
||||
// if connManager returns it has been stopped.
|
||||
close(t.stop)
|
||||
close(t.yield)
|
||||
close(t.dial)
|
||||
// close(t.ret) // we can still be dialing and wanting to send back the socket on t.ret
|
||||
}()
|
||||
return t
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user