mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2025-05-12 21:18:03 +08:00
chore: remove unneeded tls timeout in anytls
This commit is contained in:
parent
63e66f49ca
commit
feee9b320c
@ -9,7 +9,6 @@ import (
|
|||||||
|
|
||||||
"github.com/metacubex/mihomo/common/atomic"
|
"github.com/metacubex/mihomo/common/atomic"
|
||||||
"github.com/metacubex/mihomo/common/buf"
|
"github.com/metacubex/mihomo/common/buf"
|
||||||
C "github.com/metacubex/mihomo/constant"
|
|
||||||
"github.com/metacubex/mihomo/transport/anytls/padding"
|
"github.com/metacubex/mihomo/transport/anytls/padding"
|
||||||
"github.com/metacubex/mihomo/transport/anytls/session"
|
"github.com/metacubex/mihomo/transport/anytls/session"
|
||||||
"github.com/metacubex/mihomo/transport/vmess"
|
"github.com/metacubex/mihomo/transport/vmess"
|
||||||
@ -83,12 +82,7 @@ func (c *Client) CreateOutboundTLSConnection(ctx context.Context) (net.Conn, err
|
|||||||
b.WriteZeroN(paddingLen)
|
b.WriteZeroN(paddingLen)
|
||||||
}
|
}
|
||||||
|
|
||||||
getTlsConn := func() (net.Conn, error) {
|
tlsConn, err := vmess.StreamTLSConn(ctx, conn, c.tlsConfig)
|
||||||
ctx, cancel := context.WithTimeout(ctx, C.DefaultTLSTimeout)
|
|
||||||
defer cancel()
|
|
||||||
return vmess.StreamTLSConn(ctx, conn, c.tlsConfig)
|
|
||||||
}
|
|
||||||
tlsConn, err := getTlsConn()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
conn.Close()
|
conn.Close()
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Loading…
Reference in New Issue
Block a user