mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-09-22 22:58:03 +03:00
SS2022 outbound: Close connection to server on early returns (#6698)
https://github.com/XTLS/Xray-core/pull/6698#issuecomment-5468662565
This commit is contained in:
@@ -82,6 +82,7 @@ func (o *Outbound) Process(ctx context.Context, link *transport.Link, dialer int
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.New("failed to connect to server").Base(err)
|
return errors.New("failed to connect to server").Base(err)
|
||||||
}
|
}
|
||||||
|
defer connection.Close()
|
||||||
|
|
||||||
if session.TimeoutOnlyFromContext(ctx) {
|
if session.TimeoutOnlyFromContext(ctx) {
|
||||||
ctx, _ = context.WithCancel(context.Background())
|
ctx, _ = context.WithCancel(context.Background())
|
||||||
|
|||||||
Reference in New Issue
Block a user