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().
This commit is contained in:
Cuong Manh Le
2025-12-12 15:37:41 +07:00
committed by Cuong Manh Le
parent ba3dd3a4b0
commit 43d4e1957c
-5
View File
@@ -137,11 +137,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()
}
}
Log(ctx, logger.Error().Err(err), "DoH request failed")
return nil, fmt.Errorf("could not perform request: %w", err)
}