diff --git a/README.md b/README.md index eaadcf03..8d5d7002 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ namespace Tmds.Ssh; class SshClient : IDisposable { SshClient(string destination); - SshClient(SshClientSettings clientSettings); + SshClient(SshClientSettings settings); // Calling ConnectAsync is optional when SshClientSettings.AutoConnect is set (default). Task ConnectAsync(CancellationToken cancellationToken); @@ -102,11 +102,11 @@ class SftpClient : IDisposable const UnixFilePermissions DefaultCreateFilePermissions; // = '-rwxrwxrwx'. // The SftpClient owns the connection. - SftpClient(string destination, SftpClientOptions? settings = null); - SftpClient(SshClientSettings sshSettings, SftpClientOptions? sftpSettings = null); + SftpClient(string destination, SftpClientOptions? options = null); + SftpClient(SshClientSettings settings, SftpClientOptions? options = null); // The SshClient owns the connection. - SftpClient(SshClient client, SftpClientOptions? settings = null); + SftpClient(SshClient client, SftpClientOptions? options = null); // Only usable when the SftpClient was constructed directly using the constructor that accepts a destination/SshClientSettings. Task ConnectAsync(CancellationToken cancellationToken = default); diff --git a/src/Tmds.Ssh/SshClient.cs b/src/Tmds.Ssh/SshClient.cs index 4dcbe38d..ed2f98cb 100644 --- a/src/Tmds.Ssh/SshClient.cs +++ b/src/Tmds.Ssh/SshClient.cs @@ -31,9 +31,9 @@ enum State // For testing. internal bool IsDisposed => _state == State.Disposed; - public SshClient(SshClientSettings clientSettings) + public SshClient(SshClientSettings settings) { - _clientSettings = clientSettings ?? throw new ArgumentNullException(nameof(clientSettings)); + _clientSettings = settings ?? throw new ArgumentNullException(nameof(settings)); } public SshClient(string destination) @@ -201,9 +201,9 @@ public async Task OpenUnixConnectionAsync(string path, Cancellati public Task OpenSftpClientAsync(CancellationToken cancellationToken) => OpenSftpClientAsync(null, cancellationToken); - public async Task OpenSftpClientAsync(SftpClientOptions? settings = null, CancellationToken cancellationToken = default) + public async Task OpenSftpClientAsync(SftpClientOptions? options = null, CancellationToken cancellationToken = default) { - SftpClient sftpClient = new SftpClient(this, settings); + SftpClient sftpClient = new SftpClient(this, options); try { await sftpClient.OpenAsync(cancellationToken).ConfigureAwait(false); diff --git a/src/Tmds.Ssh/SshSession.cs b/src/Tmds.Ssh/SshSession.cs index 67dc86fb..ab01424a 100644 --- a/src/Tmds.Ssh/SshSession.cs +++ b/src/Tmds.Ssh/SshSession.cs @@ -36,11 +36,11 @@ sealed partial class SshSession : ISshClientImplementation public SshConnectionInfo ConnectionInfo { get; } - internal SshSession(SshClientSettings clientSettings, SshClient client) + internal SshSession(SshClientSettings settings, SshClient client) { _abortCts = new CancellationTokenSource(); - _settings = clientSettings; + _settings = settings; ConnectionInfo = new SshConnectionInfo() { diff --git a/test/Tmds.Ssh.Tests/TestServer.cs b/test/Tmds.Ssh.Tests/TestServer.cs index 72078ce7..01c16f4e 100644 --- a/test/Tmds.Ssh.Tests/TestServer.cs +++ b/test/Tmds.Ssh.Tests/TestServer.cs @@ -27,11 +27,11 @@ public async Task CreateClientAsync(Action? config { IPEndPoint ipEndPoint = (_serverSocket.LocalEndPoint as IPEndPoint)!; - var clientSettings = new SshClientSettings($"user@{ipEndPoint.Address}:{ipEndPoint.Port}"); + var settings = new SshClientSettings($"user@{ipEndPoint.Address}:{ipEndPoint.Port}"); - configure?.Invoke(clientSettings); + configure?.Invoke(settings); - var client = new SshClient(clientSettings); + var client = new SshClient(settings); await client.ConnectAsync();