From 18d62c4a1710f7cf9c0e1c277881eeb6cf6bfb92 Mon Sep 17 00:00:00 2001 From: wwqgtxx Date: Sat, 19 Nov 2022 23:16:20 +0800 Subject: [PATCH] fix: catch context.DeadlineExceeded too --- dns/doh.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dns/doh.go b/dns/doh.go index 413ede66..b5697168 100644 --- a/dns/doh.go +++ b/dns/doh.go @@ -140,7 +140,7 @@ func (doh *dnsOverHTTPS) ExchangeContext(ctx context.Context, m *D.Msg) (msg *D. msg, err = doh.exchangeHTTPS(ctx, client, m) } - if err != nil && !errors.Is(err, context.Canceled) { + if err != nil && !errors.Is(err, context.Canceled) && !errors.Is(err, context.DeadlineExceeded) { // If the request failed anyway, make sure we don't use this client. _, resErr := doh.resetClient(ctx, err)