fix: DoH recreate the connection multiple times
This commit is contained in:
parent
a79d7c80cb
commit
f26bc212e1
1 changed files with 2 additions and 1 deletions
|
@ -12,6 +12,7 @@ import (
|
||||||
"net/url"
|
"net/url"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@ -140,7 +141,7 @@ func (doh *dnsOverHTTPS) ExchangeContext(ctx context.Context, m *D.Msg) (msg *D.
|
||||||
msg, err = doh.exchangeHTTPS(ctx, client, m)
|
msg, err = doh.exchangeHTTPS(ctx, client, m)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
if err != nil && !strings.Contains(err.Error(), "context canceled") {
|
||||||
// If the request failed anyway, make sure we don't use this client.
|
// If the request failed anyway, make sure we don't use this client.
|
||||||
_, resErr := doh.resetClient(ctx, err)
|
_, resErr := doh.resetClient(ctx, err)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue