mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-11-26 03:21:43 +00:00
HTTPUpgrade client: Close the connection when the upgrade fails (#7395)
https://github.com/XTLS/Xray-core/pull/7395#issuecomment-6884592648 --------- Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5.2
parent
8f0bb9fbfa
commit
3dee8518c1
@@ -111,6 +111,7 @@ func dialhttpUpgrade(ctx context.Context, dest net.Destination, streamSettings *
|
||||
|
||||
err = req.Write(conn)
|
||||
if err != nil {
|
||||
conn.Close()
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -123,6 +124,7 @@ func dialhttpUpgrade(ctx context.Context, dest net.Destination, streamSettings *
|
||||
if transportConfiguration.Ed == 0 {
|
||||
_, err = connRF.Read([]byte{})
|
||||
if err != nil {
|
||||
conn.Close()
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user