Skip to content

Commit

Permalink
http3: do not cache dial error
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed Jun 10, 2024
1 parent 4d0562d commit 55ad3ca
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions http3/roundtrip.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ func (r *RoundTripper) RoundTripOpt(req *http.Request, opt RoundTripOpt) (*http.
}

if cl.dialErr != nil {
r.removeClient(hostname)
return nil, cl.dialErr
}
defer cl.useCount.Add(-1)
Expand Down Expand Up @@ -258,6 +259,7 @@ func (r *RoundTripper) getClient(ctx context.Context, hostname string, onlyCache
select {
case <-cl.dialing:
if cl.dialErr != nil {
delete(r.clients, hostname)
return nil, false, cl.dialErr
}
select {
Expand Down

0 comments on commit 55ad3ca

Please sign in to comment.