diff options
author | 2017-04-26 10:58:14 +0100 | |
---|---|---|
committer | 2017-04-26 10:58:14 +0100 | |
commit | 3b5b6a233fc669dfb47a6dc4eb8899c3e992cc32 (patch) | |
tree | 5db5d0834e2d3c6143387c3c96fe904782c1f5d9 /middleware/proxy/proxy.go | |
parent | 003b1bf678f6fc1d551fed5184adccde2137e86f (diff) | |
download | coredns-3b5b6a233fc669dfb47a6dc4eb8899c3e992cc32.tar.gz coredns-3b5b6a233fc669dfb47a6dc4eb8899c3e992cc32.tar.zst coredns-3b5b6a233fc669dfb47a6dc4eb8899c3e992cc32.zip |
middleware/proxy: Kill goroutines on stop (#646)
* middleware/proxy: Kill goroutines on stop
Ports caddy's https://github.com/mholt/caddy/commit/59bf71c2932c3b814a6a1211c492a1aa9f71d4a1
Excludes the proxy_test.go test part though.
Fixes #644
* Add tests
Diffstat (limited to 'middleware/proxy/proxy.go')
-rw-r--r-- | middleware/proxy/proxy.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/middleware/proxy/proxy.go b/middleware/proxy/proxy.go index ce8b99d83..5205bd06f 100644 --- a/middleware/proxy/proxy.go +++ b/middleware/proxy/proxy.go @@ -46,6 +46,8 @@ type Upstream interface { IsAllowedDomain(string) bool // Exchanger returns the exchanger to be used for this upstream. Exchanger() Exchanger + // Stops the upstream from proxying requests to shutdown goroutines cleanly. + Stop() error } // UpstreamHostDownFunc can be used to customize how Down behaves. |