forward: respect context (#6483)
Signed-off-by: Vladislav Yarmak <vladislav-ex-src@vm-0.com>
This commit is contained in:
parent
fca7ce232e
commit
8e783897a2
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue