mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-11-04 20:19:19 +02:00
H2 transport: Abandon `client` if `client.Do(request)` failed
See https://github.com/golang/go/issues/30702 Fixes https://github.com/XTLS/Xray-core/issues/2355
This commit is contained in:
parent
e603b97ab4
commit
51769fdde1
|
@ -173,6 +173,15 @@ func Dial(ctx context.Context, dest net.Destination, streamSettings *internet.Me
|
|||
if err != nil {
|
||||
newError("failed to dial to ", dest).Base(err).AtWarning().WriteToLog(session.ExportIDToError(ctx))
|
||||
wrc.Close()
|
||||
{
|
||||
// Abandon `client` if `client.Do(request)` failed
|
||||
// See https://github.com/golang/go/issues/30702
|
||||
globalDialerAccess.Lock()
|
||||
if globalDialerMap[dialerConf{dest, streamSettings}] == client {
|
||||
delete(globalDialerMap, dialerConf{dest, streamSettings})
|
||||
}
|
||||
globalDialerAccess.Unlock()
|
||||
}
|
||||
return
|
||||
}
|
||||
if response.StatusCode != 200 {
|
||||
|
|
Loading…
Reference in New Issue