mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-02-03 22:18:39 +00:00
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:
committed by
Cuong Manh Le
parent
22122c45b2
commit
705df72110
5
doh.go
5
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()
|
||||
|
||||
Reference in New Issue
Block a user