http3: close the connection when closing the roundtripper (#3873)

This commit is contained in:
Glonee
2023-06-01 16:06:13 +08:00
committed by GitHub
parent c96fbd2e4a
commit 9237dbb167
3 changed files with 8 additions and 3 deletions

View File

@@ -239,7 +239,12 @@ func (r *RoundTripper) Close() error {
}
r.clients = nil
if r.transport != nil {
r.transport.Close()
if err := r.transport.Close(); err != nil {
return err
}
if err := r.transport.Conn.Close(); err != nil {
return err
}
r.transport = nil
}
return nil