Skip to content

Commit f55a8ae

Browse files
committed
suppress new warnings introduced by merge
1 parent 76332f3 commit f55a8ae

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

src/Renci.SshNet/Common/SftpException.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ namespace Renci.SshNet.Common
1111
#if NETFRAMEWORK
1212
[Serializable]
1313
#endif
14+
#pragma warning disable CA1032 // Implement standard exception constructors
1415
public class SftpException : SshException
16+
#pragma warning restore CA1032 // Implement standard exception constructors
1517
{
1618
/// <summary>
1719
/// Gets the status code that is associated with this exception.

src/Renci.SshNet/Sftp/SftpFileStream.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,9 @@ internal static SftpFileStream Open(
164164
int bufferSize,
165165
bool isDownloadFile = false)
166166
{
167+
#pragma warning disable CA2000 // Dispose objects before losing scope
167168
return Open(session, path, mode, access, bufferSize, isDownloadFile, isAsync: false, CancellationToken.None).GetAwaiter().GetResult();
169+
#pragma warning restore CA2000 // Dispose objects before losing scope
168170
}
169171

170172
internal static Task<SftpFileStream> OpenAsync(

src/Renci.SshNet/SftpClient.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2335,13 +2335,15 @@ private async Task InternalDownloadFile(
23352335
break;
23362336
}
23372337

2338+
#pragma warning disable CA1849 // Call async methods when in an async method
23382339
var bytesRead = isAsync
23392340
#if NET
23402341
? await sftpStream.ReadAsync(buffer, cancellationToken).ConfigureAwait(false)
23412342
#else
23422343
? await sftpStream.ReadAsync(buffer, 0, buffer.Length, cancellationToken).ConfigureAwait(false)
23432344
#endif
23442345
: sftpStream.Read(buffer, 0, buffer.Length);
2346+
#pragma warning restore CA1849 // Call async methods when in an async method
23452347

23462348
if (bytesRead == 0)
23472349
{
@@ -2358,7 +2360,9 @@ private async Task InternalDownloadFile(
23582360
}
23592361
else
23602362
{
2363+
#pragma warning disable CA1849 // Call async methods when in an async method
23612364
output.Write(buffer, 0, bytesRead);
2365+
#pragma warning restore CA1849 // Call async methods when in an async method
23622366
}
23632367

23642368
totalBytesRead += (ulong)bytesRead;
@@ -2385,7 +2389,9 @@ private async Task InternalDownloadFile(
23852389
}
23862390
else
23872391
{
2392+
#pragma warning disable CA1849 // Call async methods when in an async method
23882393
sftpStream.Dispose();
2394+
#pragma warning restore CA1849 // Call async methods when in an async method
23892395
}
23902396
}
23912397
}

0 commit comments

Comments
 (0)