Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
10 changes: 5 additions & 5 deletions src/Renci.SshNet/Renci.SshNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

<PropertyGroup>
<AssemblyName>Renci.SshNet</AssemblyName>
<Product>SSH.NET</Product>
<AssemblyTitle>SSH.NET</AssemblyTitle>
<Product>Microsoft.PowerPlatform.Connector.SSH.NET</Product>
<AssemblyTitle>Microsoft.PowerPlatform.Connector.SSH.NET</AssemblyTitle>
<TargetFrameworks>net462;netstandard2.0;net8.0;net9.0;net10.0</TargetFrameworks>
</PropertyGroup>

<PropertyGroup>
<IsPackable>true</IsPackable>
<PackageId>SSH.NET</PackageId>
<Title>SSH.NET</Title>
<PackageId>Microsoft.PowerPlatform.Connector.SSH.NET</PackageId>
<Title>Microsoft.PowerPlatform.Connector.SSH.NET</Title>
<Description>SSH.NET is a Secure Shell (SSH) library for .NET, optimized for parallelism.</Description>
<Copyright>Copyright © Renci 2010-$([System.DateTime]::UtcNow.Year)</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Authors>Renci</Authors>
<Authors>Microsoft</Authors>
<PackageIcon>SS-NET-icon-h500.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageTags>ssh; scp; sftp</PackageTags>
Expand Down
14 changes: 12 additions & 2 deletions src/Renci.SshNet/SftpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2322,11 +2322,21 @@ private List<ISftpFile> InternalListDirectory(string path, SftpListDirectoryAsyn

asyncResult?.Update(result.Count);

// Call callback to report number of files read
// NOTE(apseth): Execute callback and return result if operation cancellation requested by the callback.
if (listCallback is not null)
{
// Execute callback on different thread
// Execute callback on different thread
ThreadAbstraction.ExecuteThread(() => listCallback(result.Count));
try
{
listCallback(result.Count);
}
catch (OperationCanceledException)
{
DiagnosticAbstraction.Log("The callback operation was cancelled, returning the result.");
_sftpSession.RequestClose(handle);
return result;
}
}

files = _sftpSession.RequestReadDir(handle);
Expand Down