mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-11-30 02:43:01 +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 {
|
if err != nil {
|
||||||
newError("failed to dial to ", dest).Base(err).AtWarning().WriteToLog(session.ExportIDToError(ctx))
|
newError("failed to dial to ", dest).Base(err).AtWarning().WriteToLog(session.ExportIDToError(ctx))
|
||||||
wrc.Close()
|
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
|
return
|
||||||
}
|
}
|
||||||
if response.StatusCode != 200 {
|
if response.StatusCode != 200 {
|
||||||
|
Loading…
Reference in New Issue
Block a user