aboutsummaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorGravatar Snawoot <vladislav@vm-0.com> 2024-03-07 21:54:28 +0200
committerGravatar GitHub <noreply@github.com> 2024-03-07 14:54:28 -0500
commit8e783897a23f62edab907c003469ab21e727715f (patch)
tree9cd28875ae43e80a6e43d45c0cdd26d219bac0a7 /plugin
parentfca7ce232e7053a9a8d667dd6c12843e4a34e773 (diff)
downloadcoredns-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.go2
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