@@ -138,7 +138,7 @@ public override void Flush()
138
138
/// <param name="cancellationToken"></param>
139
139
public override async Task FlushAsync ( CancellationToken cancellationToken )
140
140
{
141
- await inputStream . FlushAsync ( cancellationToken ) ;
141
+ await inputStream . FlushAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
142
142
}
143
143
144
144
/// <summary>
@@ -330,7 +330,7 @@ private async ValueTask<int> ReadAsync(Memory<byte> buffer, CancellationToken ct
330
330
331
331
while ( numToRead > 0 )
332
332
{
333
- await tarBuffer . ReadBlockIntAsync ( recBuf , ct , isAsync ) ;
333
+ await tarBuffer . ReadBlockIntAsync ( recBuf , ct , isAsync ) . ConfigureAwait ( false ) ;
334
334
335
335
var sz = ( int ) numToRead ;
336
336
@@ -379,7 +379,7 @@ protected override void Dispose(bool disposing)
379
379
/// </summary>
380
380
public override async ValueTask DisposeAsync ( )
381
381
{
382
- await tarBuffer . CloseAsync ( CancellationToken . None ) ;
382
+ await tarBuffer . CloseAsync ( CancellationToken . None ) . ConfigureAwait ( false ) ;
383
383
}
384
384
#endif
385
385
@@ -465,7 +465,7 @@ private async ValueTask SkipAsync(long skipCount, CancellationToken ct, bool isA
465
465
for ( long num = skipCount ; num > 0 ; )
466
466
{
467
467
int toRead = num > length ? length : ( int ) num ;
468
- int numRead = await ReadAsync ( skipBuf . Memory . Slice ( 0 , toRead ) , ct , isAsync ) ;
468
+ int numRead = await ReadAsync ( skipBuf . Memory . Slice ( 0 , toRead ) , ct , isAsync ) . ConfigureAwait ( false ) ;
469
469
470
470
if ( numRead == - 1 )
471
471
{
@@ -542,18 +542,18 @@ private async ValueTask<TarEntry> GetNextEntryAsync(CancellationToken ct, bool i
542
542
543
543
if ( currentEntry != null )
544
544
{
545
- await SkipToNextEntryAsync ( ct , isAsync ) ;
545
+ await SkipToNextEntryAsync ( ct , isAsync ) . ConfigureAwait ( false ) ;
546
546
}
547
547
548
548
byte [ ] headerBuf = ArrayPool < byte > . Shared . Rent ( TarBuffer . BlockSize ) ;
549
- await tarBuffer . ReadBlockIntAsync ( headerBuf , ct , isAsync ) ;
549
+ await tarBuffer . ReadBlockIntAsync ( headerBuf , ct , isAsync ) . ConfigureAwait ( false ) ;
550
550
551
551
if ( TarBuffer . IsEndOfArchiveBlock ( headerBuf ) )
552
552
{
553
553
hasHitEOF = true ;
554
554
555
555
// Read the second zero-filled block
556
- await tarBuffer . ReadBlockIntAsync ( headerBuf , ct , isAsync ) ;
556
+ await tarBuffer . ReadBlockIntAsync ( headerBuf , ct , isAsync ) . ConfigureAwait ( false ) ;
557
557
}
558
558
else
559
559
{
@@ -592,7 +592,7 @@ private async ValueTask<TarEntry> GetNextEntryAsync(CancellationToken ct, bool i
592
592
while ( numToRead > 0 )
593
593
{
594
594
var length = ( numToRead > TarBuffer . BlockSize ? TarBuffer . BlockSize : ( int ) numToRead ) ;
595
- int numRead = await ReadAsync ( nameBuffer . Memory . Slice ( 0 , length ) , ct , isAsync ) ;
595
+ int numRead = await ReadAsync ( nameBuffer . Memory . Slice ( 0 , length ) , ct , isAsync ) . ConfigureAwait ( false ) ;
596
596
597
597
if ( numRead == - 1 )
598
598
{
@@ -607,16 +607,16 @@ private async ValueTask<TarEntry> GetNextEntryAsync(CancellationToken ct, bool i
607
607
longName = longNameBuilder . ToString ( ) ;
608
608
StringBuilderPool . Instance . Return ( longNameBuilder ) ;
609
609
610
- await SkipToNextEntryAsync ( ct , isAsync ) ;
611
- await this . tarBuffer . ReadBlockIntAsync ( headerBuf , ct , isAsync ) ;
610
+ await SkipToNextEntryAsync ( ct , isAsync ) . ConfigureAwait ( false ) ;
611
+ await this . tarBuffer . ReadBlockIntAsync ( headerBuf , ct , isAsync ) . ConfigureAwait ( false ) ;
612
612
}
613
613
}
614
614
else if ( header . TypeFlag == TarHeader . LF_GHDR )
615
615
{
616
616
// POSIX global extended header
617
617
// Ignore things we dont understand completely for now
618
- await SkipToNextEntryAsync ( ct , isAsync ) ;
619
- await this . tarBuffer . ReadBlockIntAsync ( headerBuf , ct , isAsync ) ;
618
+ await SkipToNextEntryAsync ( ct , isAsync ) . ConfigureAwait ( false ) ;
619
+ await this . tarBuffer . ReadBlockIntAsync ( headerBuf , ct , isAsync ) . ConfigureAwait ( false ) ;
620
620
}
621
621
else if ( header . TypeFlag == TarHeader . LF_XHDR )
622
622
{
@@ -629,7 +629,7 @@ private async ValueTask<TarEntry> GetNextEntryAsync(CancellationToken ct, bool i
629
629
while ( numToRead > 0 )
630
630
{
631
631
var length = ( numToRead > nameBuffer . Length ? nameBuffer . Length : ( int ) numToRead ) ;
632
- int numRead = await ReadAsync ( nameBuffer . AsMemory ( ) . Slice ( 0 , length ) , ct , isAsync ) ;
632
+ int numRead = await ReadAsync ( nameBuffer . AsMemory ( ) . Slice ( 0 , length ) , ct , isAsync ) . ConfigureAwait ( false ) ;
633
633
634
634
if ( numRead == - 1 )
635
635
{
@@ -647,14 +647,14 @@ private async ValueTask<TarEntry> GetNextEntryAsync(CancellationToken ct, bool i
647
647
longName = name ;
648
648
}
649
649
650
- await SkipToNextEntryAsync ( ct , isAsync ) ;
651
- await this . tarBuffer . ReadBlockIntAsync ( headerBuf , ct , isAsync ) ;
650
+ await SkipToNextEntryAsync ( ct , isAsync ) . ConfigureAwait ( false ) ;
651
+ await this . tarBuffer . ReadBlockIntAsync ( headerBuf , ct , isAsync ) . ConfigureAwait ( false ) ;
652
652
}
653
653
else if ( header . TypeFlag == TarHeader . LF_GNU_VOLHDR )
654
654
{
655
655
// TODO: could show volume name when verbose
656
- await SkipToNextEntryAsync ( ct , isAsync ) ;
657
- await this . tarBuffer . ReadBlockIntAsync ( headerBuf , ct , isAsync ) ;
656
+ await SkipToNextEntryAsync ( ct , isAsync ) . ConfigureAwait ( false ) ;
657
+ await this . tarBuffer . ReadBlockIntAsync ( headerBuf , ct , isAsync ) . ConfigureAwait ( false ) ;
658
658
}
659
659
else if ( header . TypeFlag != TarHeader . LF_NORMAL &&
660
660
header . TypeFlag != TarHeader . LF_OLDNORM &&
@@ -663,8 +663,8 @@ private async ValueTask<TarEntry> GetNextEntryAsync(CancellationToken ct, bool i
663
663
header . TypeFlag != TarHeader . LF_DIR )
664
664
{
665
665
// Ignore things we dont understand completely for now
666
- await SkipToNextEntryAsync ( ct , isAsync ) ;
667
- await tarBuffer . ReadBlockIntAsync ( headerBuf , ct , isAsync ) ;
666
+ await SkipToNextEntryAsync ( ct , isAsync ) . ConfigureAwait ( false ) ;
667
+ await tarBuffer . ReadBlockIntAsync ( headerBuf , ct , isAsync ) . ConfigureAwait ( false ) ;
668
668
}
669
669
670
670
if ( entryFactory == null )
@@ -736,15 +736,15 @@ private async ValueTask CopyEntryContentsAsync(Stream outputStream, Cancellation
736
736
737
737
while ( true )
738
738
{
739
- int numRead = await ReadAsync ( tempBuffer , ct , isAsync ) ;
739
+ int numRead = await ReadAsync ( tempBuffer , ct , isAsync ) . ConfigureAwait ( false ) ;
740
740
if ( numRead <= 0 )
741
741
{
742
742
break ;
743
743
}
744
744
745
745
if ( isAsync )
746
746
{
747
- await outputStream . WriteAsync ( tempBuffer , 0 , numRead , ct ) ;
747
+ await outputStream . WriteAsync ( tempBuffer , 0 , numRead , ct ) . ConfigureAwait ( false ) ;
748
748
}
749
749
else
750
750
{
@@ -761,7 +761,7 @@ private async ValueTask SkipToNextEntryAsync(CancellationToken ct, bool isAsync)
761
761
762
762
if ( numToSkip > 0 )
763
763
{
764
- await SkipAsync ( numToSkip , ct , isAsync ) ;
764
+ await SkipAsync ( numToSkip , ct , isAsync ) . ConfigureAwait ( false ) ;
765
765
}
766
766
767
767
readBuffer ? . Dispose ( ) ;
0 commit comments