From dd66f8826c89dd1f3be3906d8e962ea350090024 Mon Sep 17 00:00:00 2001 From: gVisor bot Date: Sun, 3 Jul 2022 23:01:49 +0800 Subject: [PATCH] fix: close transport with doh of h3 --- dns/doh.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dns/doh.go b/dns/doh.go index 5010bbcb..08d0d172 100644 --- a/dns/doh.go +++ b/dns/doh.go @@ -78,6 +78,12 @@ func (dc *dohClient) doRequest(req *http.Request) (msg *D.Msg, err error) { _ = dc.h3Transport.Close() dc.h3Transport = nil } + } else { + if dc.firstTest.CAS(true, false) { + dc.supportH3.Store(true) + _ = dc.transport.CloseIdleConnections + dc.transport = nil + } } } else { msg, err = dc.doRequestWithTransport(req, dc.transport)