mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-03-13 10:26:06 +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
6c02b161bf
commit
d6d43fccd3
5
doh.go
5
doh.go
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user