mirror of
https://github.com/coredns/coredns.git
synced 2025-11-01 02:33:14 -04:00
middleware/proxy: Kill goroutines on stop (#646)
* middleware/proxy: Kill goroutines on stop
Ports caddy's 59bf71c293
Excludes the proxy_test.go test part though.
Fixes #644
* Add tests
This commit is contained in:
@@ -21,6 +21,8 @@ func NewLookup(hosts []string) Proxy {
|
||||
func NewLookupWithOption(hosts []string, opts Options) Proxy {
|
||||
p := Proxy{Next: nil}
|
||||
|
||||
// TODO(miek): this needs to be unified with upstream.go's NewStaticUpstreams, caddy uses NewHost
|
||||
// we should copy/make something similar.
|
||||
upstream := &staticUpstream{
|
||||
from: ".",
|
||||
Hosts: make([]*UpstreamHost, len(hosts)),
|
||||
|
||||
Reference in New Issue
Block a user