Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tar): enable async overrides on net6 #811

Merged
merged 1 commit into from
Dec 16, 2022
Merged
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
4 changes: 2 additions & 2 deletions src/ICSharpCode.SharpZipLib/Tar/TarBuffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ private async ValueTask CloseAsync(CancellationToken ct, bool isAsync)
{
if (isAsync)
{
#if NETSTANDARD2_1_OR_GREATER
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
await outputStream.DisposeAsync().ConfigureAwait(false);
#else
outputStream.Dispose();
Expand All @@ -660,7 +660,7 @@ private async ValueTask CloseAsync(CancellationToken ct, bool isAsync)
{
if (isAsync)
{
#if NETSTANDARD2_1_OR_GREATER
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
await inputStream.DisposeAsync().ConfigureAwait(false);
#else
inputStream.Dispose();
Expand Down
2 changes: 1 addition & 1 deletion src/ICSharpCode.SharpZipLib/Tar/TarHeader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,7 @@ public static string ParseName(ReadOnlySpan<byte> header, Encoding encoding)
}
}

#if NETSTANDARD2_1_OR_GREATER
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
var value = encoding.GetString(header.Slice(0, count));
#else
var value = encoding.GetString(header.ToArray(), 0, count);
Expand Down
4 changes: 2 additions & 2 deletions src/ICSharpCode.SharpZipLib/Tar/TarInputStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public override Task<int> ReadAsync(byte[] buffer, int offset, int count, Cancel
return ReadAsync(buffer.AsMemory().Slice(offset, count), cancellationToken, true).AsTask();
}

#if NETSTANDARD2_1_OR_GREATER
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
/// <summary>
/// Reads bytes from the current tar archive entry.
///
Expand Down Expand Up @@ -372,7 +372,7 @@ protected override void Dispose(bool disposing)
}
}

#if NETSTANDARD2_1_OR_GREATER
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
/// <summary>
/// Closes this stream. Calls the TarBuffer's close() method.
/// The underlying stream is closed by the TarBuffer.
Expand Down