From 705df721104c8962261316f6202949b0826024dd Mon Sep 17 00:00:00 2001 From: Cuong Manh Le Date: Fri, 12 Dec 2025 15:37:41 +0700 Subject: [PATCH] fix: remove incorrect transport close on DoH3 error Remove the transport Close() call from DoH3 error handling path. The transport is shared and reused across requests, and closing it on error would break subsequent requests. The transport lifecycle is already properly managed by the http.Client and the finalizer set in newDOH3Transport(). --- doh.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/doh.go b/doh.go index 3459cb8..58aaf16 100644 --- a/doh.go +++ b/doh.go @@ -122,11 +122,6 @@ func (r *dohResolver) Resolve(ctx context.Context, msg *dns.Msg) (*dns.Msg, erro } if err != nil { err = wrapUrlError(err) - if r.isDoH3 { - if closer, ok := c.Transport.(io.Closer); ok { - closer.Close() - } - } return nil, fmt.Errorf("could not perform request: %w", err) } defer resp.Body.Close()