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

Don't dispose compressed ouitput stream #251

Merged
merged 3 commits into from
Nov 13, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
analyze:
runs-on: windows-latest
steps:
- name: Set up JDK 11
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: 11
Expand Down
11 changes: 5 additions & 6 deletions PgpCore/PGP.cs
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@
{
PgpCompressedDataGenerator comData = new PgpCompressedDataGenerator(CompressionAlgorithm);
await Utilities.WriteStreamToLiteralDataAsync(comData.Open(@out), FileTypeToChar(), inputStream, name);
comData.Close();

Check warning on line 567 in PgpCore/PGP.cs

View workflow job for this annotation

GitHub Actions / build / build

'PgpCompressedDataGenerator.Close()' is obsolete: 'Dispose any opened Stream directly'
}
else
await Utilities.WriteStreamToLiteralDataAsync(@out, FileTypeToChar(), inputStream, name);
Expand Down Expand Up @@ -683,7 +683,7 @@
{
PgpCompressedDataGenerator comData = new PgpCompressedDataGenerator(CompressionAlgorithm);
Utilities.WriteStreamToLiteralData(comData.Open(@out), FileTypeToChar(), inputStream, name);
comData.Close();

Check warning on line 686 in PgpCore/PGP.cs

View workflow job for this annotation

GitHub Actions / build / build

'PgpCompressedDataGenerator.Close()' is obsolete: 'Dispose any opened Stream directly'
}
else
Utilities.WriteStreamToLiteralData(@out, FileTypeToChar(), inputStream, name);
Expand Down Expand Up @@ -5010,13 +5010,12 @@
private async Task OutputSignedAsync(Stream inputStream, Stream outputStream,
string name)
{
using (Stream compressedOut = ChainCompressedOut(outputStream))
Stream compressedOut = ChainCompressedOut(outputStream);

PgpSignatureGenerator signatureGenerator = InitSignatureGenerator(compressedOut);
using (Stream literalOut = ChainLiteralStreamOut(compressedOut, inputStream, name))
{
PgpSignatureGenerator signatureGenerator = InitSignatureGenerator(compressedOut);
using (Stream literalOut = ChainLiteralStreamOut(compressedOut, inputStream, name))
{
await WriteOutputAndSignAsync(compressedOut, literalOut, inputStream, signatureGenerator);
}
await WriteOutputAndSignAsync(compressedOut, literalOut, inputStream, signatureGenerator);
}
}

Expand Down
6 changes: 3 additions & 3 deletions PgpCore/PgpCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
<PackageProjectUrl>https://github.com/mattosaurus/PgpCore</PackageProjectUrl>
<RepositoryUrl>https://github.com/mattosaurus/PgpCore</RepositoryUrl>
<PackageTags>PGP .NET Core</PackageTags>
<Version>5.13.0.0</Version>
<Version>5.13.1.0</Version>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<FileVersion>5.13.0</FileVersion>
<PackageReleaseNotes>v5.13.0 - Add prefered encryption key</PackageReleaseNotes>
<FileVersion>5.13.1</FileVersion>
<PackageReleaseNotes>v5.13.1 - Don't dispose compressed output stream</PackageReleaseNotes>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSymbols>true</IncludeSymbols>
Expand Down
Loading