Skip to content

Conversation

@piksel
Copy link
Member

@piksel piksel commented Dec 15, 2022

This PR fixes the async finishing of entries in ZipOutputStream. The initial problem was that there was a sneaky base.Finish() call in WriteEntryFooter which in turn wrote synchronously to the output stream when called.
Additionally, DeflateOutputSteam.AsyncDispose was not included when targeting .NET 6 due to the preprocessor constants for NETSTANDARD2_1_OR_GREATER not being defined.

This also adds tests that ensures that writing zip streams can be done wholly async, without calling any of the output streams synchronous methods.

Fixes #801

I certify that I own, and have sufficient rights to contribute, all source code and related material intended to be compiled or integrated with the source code for the SharpZipLib open source product (the "Contribution"). My Contribution is licensed under the MIT License.

@codecov
Copy link

codecov bot commented Dec 15, 2022

Codecov Report

Merging #808 (759570e) into master (cdd0931) will increase coverage by 0.05%.
The diff coverage is 93.33%.

@@            Coverage Diff             @@
##           master     #808      +/-   ##
==========================================
+ Coverage   74.72%   74.77%   +0.05%     
==========================================
  Files          72       72              
  Lines        8485     8501      +16     
==========================================
+ Hits         6340     6357      +17     
+ Misses       2145     2144       -1     
Impacted Files Coverage Δ
...ib/Zip/Compression/Streams/DeflaterOutputStream.cs 82.72% <ø> (+1.72%) ⬆️
src/ICSharpCode.SharpZipLib/Zip/ZipOutputStream.cs 88.57% <93.33%> (+0.70%) ⬆️
src/ICSharpCode.SharpZipLib/Zip/ZipInputStream.cs 82.87% <0.00%> (-0.16%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@piksel piksel merged commit cbb9e83 into master Dec 15, 2022
@piksel piksel deleted the fix/async-zos-finish branch December 15, 2022 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ZipOutputStream calls sync DeflaterOutputStream.Finish from async

2 participants