mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-11-25 10:01:28 +00: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 a new issue