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:
patterniha
2026-11-21 20:40:13 +00:00
committed by GitHub
co-authored by Claude Fable 5.2
parent 8f0bb9fbfa
commit 3dee8518c1
+2
View File
@@ -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
}
}