merge: Merge upstream v1.14.6

This commit is contained in:
Shtorm
2026-11-30 19:46:00 +03:00
292 changed files with 6311 additions and 5159 deletions
+14 -15
View File
@@ -141,24 +141,23 @@ func (s *Outbound) connect(ctx context.Context) (client *ssh.Client, err error)
return s.client, nil
}
conn, err := s.dialer.DialContext(ctx, N.NetworkTCP, s.serverAddr)
conn, err := s.dialer.DialContext(adapter.ContextForMultiplexSession(ctx), N.NetworkTCP, s.serverAddr)
if err != nil {
return nil, err
}
if ctx.Done() != nil {
handshakeConn := conn
stopContext := context.AfterFunc(ctx, func() {
_ = handshakeConn.Close()
})
defer func() {
if !stopContext() {
s.client = nil
s.clientConn = nil
client = nil
err = ctx.Err()
}
}()
}
ctx, cancel := context.WithTimeout(ctx, C.TCPTimeout)
defer cancel()
stopContext := context.AfterFunc(ctx, func() {
_ = conn.Close()
})
defer func() {
if !stopContext() {
s.client = nil
s.clientConn = nil
client = nil
err = E.Cause(ctx.Err(), "connect to ssh server")
}
}()
config := &ssh.ClientConfig{
User: s.user,
Auth: s.authMethod,