@@ -2269,7 +2269,7 @@ private List<ISftpFile> InternalListDirectory(string path, SftpListDirectoryAsyn
22692269 return result ;
22702270 }
22712271
2272- #pragma warning disable S6966 // Awaitable method should be used
2272+ #pragma warning disable CA1849 // Call async methods when in an async method
22732273 private async Task InternalDownloadFile (
22742274 string path ,
22752275 Stream output ,
@@ -2330,15 +2330,13 @@ private async Task InternalDownloadFile(
23302330 break ;
23312331 }
23322332
2333- #pragma warning disable CA1849 // Call async methods when in an async method
23342333 var bytesRead = isAsync
23352334#if NET
23362335 ? await sftpStream . ReadAsync ( buffer , cancellationToken ) . ConfigureAwait ( false )
23372336#else
23382337 ? await sftpStream . ReadAsync ( buffer , 0 , buffer . Length , cancellationToken ) . ConfigureAwait ( false )
23392338#endif
23402339 : sftpStream. Read ( buffer , 0 , buffer . Length ) ;
2341- #pragma warning restore CA1849 // Call async methods when in an async method
23422340
23432341 if ( bytesRead == 0 )
23442342 {
@@ -2355,9 +2353,7 @@ private async Task InternalDownloadFile(
23552353 }
23562354 else
23572355 {
2358- #pragma warning disable CA1849 // Call async methods when in an async method
23592356 output . Write ( buffer , 0 , bytesRead ) ;
2360- #pragma warning restore CA1849 // Call async methods when in an async method
23612357 }
23622358
23632359 totalBytesRead += ( ulong ) bytesRead ;
@@ -2384,15 +2380,11 @@ private async Task InternalDownloadFile(
23842380 }
23852381 else
23862382 {
2387- #pragma warning disable CA1849 // Call async methods when in an async method
23882383 sftpStream . Dispose ( ) ;
2389- #pragma warning restore CA1849 // Call async methods when in an async method
23902384 }
23912385 }
23922386 }
2393- #pragma warning restore S6966 // Awaitable method should be used
23942387
2395- #pragma warning disable S6966 // Awaitable method should be used
23962388 private async Task InternalUploadFile (
23972389 Stream input ,
23982390 string path ,
@@ -2439,15 +2431,13 @@ private async Task InternalUploadFile(
24392431
24402432 while ( true )
24412433 {
2442- #pragma warning disable CA1849 // Call async methods when in an async method
24432434 var bytesRead = isAsync
24442435#if NET
24452436 ? await input . ReadAsync ( buffer , cancellationToken ) . ConfigureAwait ( false )
24462437#else
24472438 ? await input . ReadAsync ( buffer , 0 , buffer . Length , cancellationToken ) . ConfigureAwait ( false )
24482439#endif
24492440 : input. Read ( buffer , 0 , buffer . Length ) ;
2450- #pragma warning restore CA1849 // Call async methods when in an async method
24512441
24522442 if ( bytesRead == 0 )
24532443 {
@@ -2533,7 +2523,7 @@ private async Task InternalUploadFile(
25332523 _sftpSession . RequestClose ( handle ) ;
25342524 }
25352525 }
2536- #pragma warning restore S6966 // Awaitable method should be used
2526+ #pragma warning restore CA1849 // Call async methods when in an async method
25372527
25382528 /// <summary>
25392529 /// Called when client is connected to the server.
0 commit comments