diff options
author | 2024-03-07 21:54:28 +0200 | |
---|---|---|
committer | 2024-03-07 14:54:28 -0500 | |
commit | 8e783897a23f62edab907c003469ab21e727715f (patch) | |
tree | 9cd28875ae43e80a6e43d45c0cdd26d219bac0a7 /plugin | |
parent | fca7ce232e7053a9a8d667dd6c12843e4a34e773 (diff) | |
download | coredns-8e783897a23f62edab907c003469ab21e727715f.tar.gz coredns-8e783897a23f62edab907c003469ab21e727715f.tar.zst coredns-8e783897a23f62edab907c003469ab21e727715f.zip |
forward: respect context (#6483)
Signed-off-by: Vladislav Yarmak <vladislav-ex-src@vm-0.com>
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/forward/forward.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/plugin/forward/forward.go b/plugin/forward/forward.go index e53d74ae2..d8bbe7ab9 100644 --- a/plugin/forward/forward.go +++ b/plugin/forward/forward.go @@ -110,7 +110,7 @@ func (f *Forward) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg list := f.List() deadline := time.Now().Add(defaultTimeout) start := time.Now() - for time.Now().Before(deadline) { + for time.Now().Before(deadline) && ctx.Err() == nil { if i >= len(list) { // reached the end of list, reset to begin i = 0 |