Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 19 additions & 16 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Avoid looking for .editorconfig files in parent directories
# Avoid looking for .editorconfig files in parent directories
root=true

[*]
Expand All @@ -7,6 +7,9 @@ insert_final_newline = true
indent_style = space
indent_size = 4
tab_width = 4
spelling_languages = en-us,en-gb
spelling_exclusion_path = exclusion.dic
spelling_checkable_types = all

[*.{xml,csproj,props}]

Expand Down Expand Up @@ -776,14 +779,14 @@ dotnet_diagnostic.IDE0032.severity = suggestion
dotnet_diagnostic.IDE0045.severity = none

# IDE0046: Use conditional expression for return
#
#
# Using a conditional expression is not always a clear win for readability.
#
# Configured using 'dotnet_style_prefer_conditional_expression_over_return'
dotnet_diagnostic.IDE0046.severity = suggestion

# IDE0047: Remove unnecessary parentheses
#
#
# Removing "unnecessary" parentheses is not always a clear win for readability.
dotnet_diagnostic.IDE0047.severity = suggestion

Expand All @@ -794,7 +797,7 @@ dotnet_diagnostic.IDE0047.severity = suggestion
dotnet_diagnostic.IDE0130.severity = none

# IDE0270: Null check can be simplified
#
#
# var inputPath = originalDossierPathList.Find(x => x.id == updatedPath.id);
# if (inputPath is null)
# {
Expand Down Expand Up @@ -938,7 +941,7 @@ csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
# Enabling this setting breaks Resharper formatting for an enum field reference that is
# deeply nested in an object initializer.
#
#
# For an example, see TDataExchangeGeneralEnricher_CernInfrastructureObstruction.
#csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true
Expand Down Expand Up @@ -1021,19 +1024,19 @@ dotnet_naming_rule.private_const_fields_pascal_case.severity = warning

dotnet_naming_symbols.interface.applicable_kinds = interface
dotnet_naming_symbols.interface.applicable_accessibilities = *
dotnet_naming_symbols.interface.required_modifiers =
dotnet_naming_symbols.interface.required_modifiers =

dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
dotnet_naming_symbols.types.applicable_accessibilities = *
dotnet_naming_symbols.types.required_modifiers =
dotnet_naming_symbols.types.required_modifiers =

dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
dotnet_naming_symbols.non_field_members.applicable_accessibilities = *
dotnet_naming_symbols.non_field_members.required_modifiers =
dotnet_naming_symbols.non_field_members.required_modifiers =

dotnet_naming_symbols.private_fields.applicable_kinds = field
dotnet_naming_symbols.private_fields.applicable_accessibilities = private
dotnet_naming_symbols.private_fields.required_modifiers =
dotnet_naming_symbols.private_fields.required_modifiers =

dotnet_naming_symbols.private_static_fields.applicable_kinds = field
dotnet_naming_symbols.private_static_fields.applicable_accessibilities = private
Expand All @@ -1050,18 +1053,18 @@ dotnet_naming_symbols.private_const_fields.required_modifiers = const
# Naming styles

dotnet_naming_style.begins_with_i.required_prefix = I
dotnet_naming_style.begins_with_i.required_suffix =
dotnet_naming_style.begins_with_i.word_separator =
dotnet_naming_style.begins_with_i.required_suffix =
dotnet_naming_style.begins_with_i.word_separator =
dotnet_naming_style.begins_with_i.capitalization = pascal_case

dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case

dotnet_naming_style.camel_case_begins_with_underscore.required_prefix = _
dotnet_naming_style.camel_case_begins_with_underscore.required_suffix =
dotnet_naming_style.camel_case_begins_with_underscore.word_separator =
dotnet_naming_style.camel_case_begins_with_underscore.required_suffix =
dotnet_naming_style.camel_case_begins_with_underscore.word_separator =
dotnet_naming_style.camel_case_begins_with_underscore.capitalization = camel_case

#### .NET Compiler Platform general options ####
Expand Down
1 change: 1 addition & 0 deletions Renci.SshNet.sln
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
CONTRIBUTING.md = CONTRIBUTING.md
Directory.Build.props = Directory.Build.props
Directory.Packages.props = Directory.Packages.props
exclusion.dic = exclusion.dic
global.json = global.json
LICENSE = LICENSE
nuget.config = nuget.config
Expand Down
Binary file added exclusion.dic
Binary file not shown.
3 changes: 3 additions & 0 deletions src/Renci.SshNet/.editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
[*.cs]
spelling_languages = en-us,en-gb
spelling_exclusion_path = ../exclusion.dic
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the file this is pointing to has only 2 words, both already included in the top-level file. Is it an artifact of earlier changes?

Suggested change
spelling_exclusion_path = ../exclusion.dic
spelling_exclusion_path = ../../exclusion.dic

spelling_checkable_types = all

#### Sonar rules ####

Expand Down
2 changes: 1 addition & 1 deletion src/Renci.SshNet/Abstractions/SocketAbstraction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ public static void Send(Socket socket, byte[] data, int offset, int size)
}
else
{
throw; // any serious error occurr
throw; // any serious error occur
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/Renci.SshNet/BaseClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ protected virtual void OnDisconnected()
{
}

private void Session_ErrorOccured(object? sender, ExceptionEventArgs e)
private void Session_ErrorOccurred(object? sender, ExceptionEventArgs e)
{
ErrorOccurred?.Invoke(this, e);
}
Expand Down Expand Up @@ -558,7 +558,7 @@ private ISession CreateAndConnectSession()
var session = _serviceFactory.CreateSession(ConnectionInfo, _serviceFactory.CreateSocketFactory());
session.ServerIdentificationReceived += Session_ServerIdentificationReceived;
session.HostKeyReceived += Session_HostKeyReceived;
session.ErrorOccured += Session_ErrorOccured;
session.ErrorOccured += Session_ErrorOccurred;

try
{
Expand All @@ -577,7 +577,7 @@ private async Task<ISession> CreateAndConnectSessionAsync(CancellationToken canc
var session = _serviceFactory.CreateSession(ConnectionInfo, _serviceFactory.CreateSocketFactory());
session.ServerIdentificationReceived += Session_ServerIdentificationReceived;
session.HostKeyReceived += Session_HostKeyReceived;
session.ErrorOccured += Session_ErrorOccured;
session.ErrorOccured += Session_ErrorOccurred;

try
{
Expand All @@ -593,7 +593,7 @@ private async Task<ISession> CreateAndConnectSessionAsync(CancellationToken canc

private void DisposeSession(ISession session)
{
session.ErrorOccured -= Session_ErrorOccured;
session.ErrorOccured -= Session_ErrorOccurred;
session.HostKeyReceived -= Session_HostKeyReceived;
session.ServerIdentificationReceived -= Session_ServerIdentificationReceived;
session.Dispose();
Expand Down
18 changes: 9 additions & 9 deletions src/Renci.SshNet/Channels/Channel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,15 @@ protected Channel(ISession session, uint localChannelNumber, uint localWindowSiz
session.ChannelRequestReceived += OnChannelRequest;
session.ChannelSuccessReceived += OnChannelSuccess;
session.ChannelFailureReceived += OnChannelFailure;
session.ErrorOccured += Session_ErrorOccured;
session.ErrorOccured += Session_ErrorOccurred;
session.Disconnected += Session_Disconnected;
}

/// <summary>
/// Gets the session.
/// </summary>
/// <value>
/// Thhe session.
/// The session.
/// </value>
protected ISession Session
{
Expand Down Expand Up @@ -328,7 +328,7 @@ public void SendData(byte[] data)
/// multiple chunks and will wait for the remote window size to be adjusted when it's zero.
/// </para>
/// <para>
/// This is done to support SSH servers will a small window size that do not agressively
/// This is done to support SSH servers will a small window size that do not aggressively
/// increase their window size. We need to take into account that there may be SSH servers
/// that only increase their window size when it has reached zero.
/// </para>
Expand Down Expand Up @@ -586,7 +586,7 @@ protected virtual void OnDisconnected()
{
}

protected virtual void OnErrorOccured(Exception exp)
protected virtual void OnErrorOccurred(Exception exp)
{
}

Expand All @@ -609,20 +609,20 @@ private void Session_Disconnected(object sender, EventArgs e)
/// </summary>
/// <param name="ex">The <see cref="Exception"/>.</param>
/// <remarks>
/// This method will in turn invoke <see cref="OnErrorOccured(System.Exception)"/>, and
/// This method will in turn invoke <see cref="OnErrorOccurred(System.Exception)"/>, and
/// raise the <see cref="Exception"/> event.
/// </remarks>
protected void OnChannelException(Exception ex)
{
OnErrorOccured(ex);
OnErrorOccurred(ex);
RaiseExceptionEvent(ex);
}

private void Session_ErrorOccured(object sender, ExceptionEventArgs e)
private void Session_ErrorOccurred(object sender, ExceptionEventArgs e)
{
try
{
OnErrorOccured(e.Exception);
OnErrorOccurred(e.Exception);
}
catch (Exception ex)
{
Expand Down Expand Up @@ -854,7 +854,7 @@ protected virtual void Dispose(bool disposing)
session.ChannelRequestReceived -= OnChannelRequest;
session.ChannelSuccessReceived -= OnChannelSuccess;
session.ChannelFailureReceived -= OnChannelFailure;
session.ErrorOccured -= Session_ErrorOccured;
session.ErrorOccured -= Session_ErrorOccurred;
session.Disconnected -= Session_Disconnected;
}

Expand Down
6 changes: 3 additions & 3 deletions src/Renci.SshNet/Channels/ChannelDirectTcpip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@ protected override void OnEof()
/// Called whenever an unhandled <see cref="Exception"/> occurs in <see cref="Session"/> causing
/// the message loop to be interrupted, or when an exception occurred processing a channel message.
/// </summary>
protected override void OnErrorOccured(Exception exp)
protected override void OnErrorOccurred(Exception exp)
{
base.OnErrorOccured(exp);
base.OnErrorOccurred(exp);

// signal to the client that we will not send anything anymore; this will also interrupt the
// blocking receive in Bind if the client sends FIN/ACK in time
Expand All @@ -261,7 +261,7 @@ protected override void OnErrorOccured(Exception exp)
}

/// <summary>
/// Called when the server wants to terminate the connection immmediately.
/// Called when the server wants to terminate the connection immediately.
/// </summary>
/// <remarks>
/// The sender MUST NOT send or receive any data after this message, and
Expand Down
4 changes: 2 additions & 2 deletions src/Renci.SshNet/Channels/ChannelForwardedTcpip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ public void Bind(IPEndPoint remoteEndpoint, IForwardedPort forwardedPort)
SocketAbstraction.ReadContinuous(_socket, buffer, 0, buffer.Length, SendData);
}

protected override void OnErrorOccured(Exception exp)
protected override void OnErrorOccurred(Exception exp)
{
base.OnErrorOccured(exp);
base.OnErrorOccurred(exp);

// signal to the server that we will not send anything anymore; this will also interrupt the
// blocking receive in Bind if the server sends FIN/ACK in time
Expand Down
24 changes: 12 additions & 12 deletions src/Renci.SshNet/Channels/ChannelSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ internal sealed class ChannelSession : ClientChannel, IChannelSession

private EventWaitHandle _channelRequestResponse = new ManualResetEvent(initialState: false);

private bool _channelRequestSucces;
private bool _channelRequestSuccess;

/// <summary>
/// Initializes a new instance of the <see cref="ChannelSession"/> class.
Expand Down Expand Up @@ -136,7 +136,7 @@ public bool SendPseudoTerminalRequest(string environmentVariable, uint columns,
_ = _channelRequestResponse.Reset();
SendMessage(new ChannelRequestMessage(RemoteChannelNumber, new PseudoTerminalRequestInfo(environmentVariable, columns, rows, width, height, terminalModeValues)));
WaitOnHandle(_channelRequestResponse);
return _channelRequestSucces;
return _channelRequestSuccess;
}

/// <summary>
Expand All @@ -154,7 +154,7 @@ public bool SendX11ForwardingRequest(bool isSingleConnection, string protocol, b
_ = _channelRequestResponse.Reset();
SendMessage(new ChannelRequestMessage(RemoteChannelNumber, new X11ForwardingRequestInfo(isSingleConnection, protocol, cookie, screenNumber)));
WaitOnHandle(_channelRequestResponse);
return _channelRequestSucces;
return _channelRequestSuccess;
}

/// <summary>
Expand All @@ -170,7 +170,7 @@ public bool SendEnvironmentVariableRequest(string variableName, string variableV
_ = _channelRequestResponse.Reset();
SendMessage(new ChannelRequestMessage(RemoteChannelNumber, new EnvironmentVariableRequestInfo(variableName, variableValue)));
WaitOnHandle(_channelRequestResponse);
return _channelRequestSucces;
return _channelRequestSuccess;
}

/// <summary>
Expand All @@ -184,7 +184,7 @@ public bool SendShellRequest()
_ = _channelRequestResponse.Reset();
SendMessage(new ChannelRequestMessage(RemoteChannelNumber, new ShellRequestInfo()));
WaitOnHandle(_channelRequestResponse);
return _channelRequestSucces;
return _channelRequestSuccess;
}

/// <summary>
Expand All @@ -199,7 +199,7 @@ public bool SendExecRequest(string command)
_ = _channelRequestResponse.Reset();
SendMessage(new ChannelRequestMessage(RemoteChannelNumber, new ExecRequestInfo(command, ConnectionInfo.Encoding)));
WaitOnHandle(_channelRequestResponse);
return _channelRequestSucces;
return _channelRequestSuccess;
}

/// <summary>
Expand All @@ -214,7 +214,7 @@ public bool SendBreakRequest(uint breakLength)
_ = _channelRequestResponse.Reset();
SendMessage(new ChannelRequestMessage(RemoteChannelNumber, new BreakRequestInfo(breakLength)));
WaitOnHandle(_channelRequestResponse);
return _channelRequestSucces;
return _channelRequestSuccess;
}

/// <summary>
Expand All @@ -229,7 +229,7 @@ public bool SendSubsystemRequest(string subsystem)
_ = _channelRequestResponse.Reset();
SendMessage(new ChannelRequestMessage(RemoteChannelNumber, new SubsystemRequestInfo(subsystem)));
WaitOnHandle(_channelRequestResponse);
return _channelRequestSucces;
return _channelRequestSuccess;
}

/// <summary>
Expand Down Expand Up @@ -277,7 +277,7 @@ public bool SendEndOfWriteRequest()
_ = _channelRequestResponse.Reset();
SendMessage(new ChannelRequestMessage(RemoteChannelNumber, new EndOfWriteRequestInfo()));
WaitOnHandle(_channelRequestResponse);
return _channelRequestSucces;
return _channelRequestSuccess;
}

/// <summary>
Expand All @@ -291,7 +291,7 @@ public bool SendKeepAliveRequest()
_ = _channelRequestResponse.Reset();
SendMessage(new ChannelRequestMessage(RemoteChannelNumber, new KeepAliveRequestInfo()));
WaitOnHandle(_channelRequestResponse);
return _channelRequestSucces;
return _channelRequestSuccess;
}

/// <summary>
Expand All @@ -301,7 +301,7 @@ protected override void OnSuccess()
{
base.OnSuccess();

_channelRequestSucces = true;
_channelRequestSuccess = true;
_ = _channelRequestResponse?.Set();
}

Expand All @@ -312,7 +312,7 @@ protected override void OnFailure()
{
base.OnFailure();

_channelRequestSucces = false;
_channelRequestSuccess = false;
_ = _channelRequestResponse?.Set();
}

Expand Down
2 changes: 1 addition & 1 deletion src/Renci.SshNet/Channels/IChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ internal interface IChannel : IDisposable
/// multiple chunks and will wait for the remote window size to be adjusted when it's zero.
/// </para>
/// <para>
/// This is done to support SSH servers will a small window size that do not agressively
/// This is done to support SSH servers will a small window size that do not aggressively
/// increase their window size. We need to take into account that there may be SSH servers
/// that only increase their window size when it has reached zero.
/// </para>
Expand Down
2 changes: 1 addition & 1 deletion src/Renci.SshNet/ClientAuthentication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ private bool TryAuthenticate(ISession session,

foreach (var authenticationMethod in authenticationState.GetActiveAuthenticationMethods(matchingAuthenticationMethods))
{
// guard against a stack overlow for servers that do not update the list of allowed authentication
// guard against a stack overflow for servers that do not update the list of allowed authentication
// methods after a partial success
if (authenticationState.GetPartialSuccessCount(authenticationMethod) >= _partialSuccessLimit)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Renci.SshNet/Common/ExceptionEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Renci.SshNet.Common
{
/// <summary>
/// Provides data for the ErrorOccured events.
/// Provides data for the ErrorOccurred events.
/// </summary>
public class ExceptionEventArgs : EventArgs
{
Expand Down
Loading