mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-30 17:38:41 +00:00
Fixing tcp connestions leak
- always use HandshakeContext instead of Handshake - pickup dailer dropped ctx - rename HandshakeContextAddress to HandshakeAddressContext
This commit is contained in:
parent
5ea1315b85
commit
cae94570df
7 changed files with 38 additions and 18 deletions
|
@ -96,7 +96,7 @@ func dialWebSocket(ctx context.Context, dest net.Destination, streamSettings *in
|
|||
}
|
||||
// TLS and apply the handshake
|
||||
cn := tls.UClient(pconn, tlsConfig, fingerprint).(*tls.UConn)
|
||||
if err := cn.WebsocketHandshake(); err != nil {
|
||||
if err := cn.WebsocketHandshakeContext(ctx); err != nil {
|
||||
newError("failed to dial to " + addr).Base(err).AtError().WriteToLog()
|
||||
return nil, err
|
||||
}
|
||||
|
@ -147,7 +147,7 @@ func dialWebSocket(ctx context.Context, dest net.Destination, streamSettings *in
|
|||
header.Set("Sec-WebSocket-Protocol", base64.RawURLEncoding.EncodeToString(ed))
|
||||
}
|
||||
|
||||
conn, resp, err := dialer.Dial(uri, header)
|
||||
conn, resp, err := dialer.DialContext(ctx, uri, header)
|
||||
if err != nil {
|
||||
var reason string
|
||||
if resp != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue