This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Add managed Deflate64 support to ZipArchive #11264
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Aug 31, 2016
_buffer = new byte[DefaultBufferSize]; | ||
} | ||
|
||
private static IDeflater CreateDeflater(CompressionLevel? compressionLevel) | ||
/// <summary> | ||
/// Sets up this DeflateManagedStream to be used for Zlib Deflation/Compression |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is counter-intuitive... the managed implementation is using zlib?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I built this DeflateStream off of the existing one so they'd be minimally different if we decided to merge them later. I remove this comment in a later commit.
A few questions/comments, otherwise LGTM, assuming the new tests you added pass. |
- Rename managed deflater to DeflateManagedStream, make internal - Bring over some improvements from the internal DeflateStream to the DeflateManagedStream - Remove the files that aren't getting used anymore - Move native deflate files to their own folder to make the separation clearer - Update the .NET license headers in the managed deflate files
Modifies our Managed Deflate implementation to accept Deflate64 streams when an internal bool is set. When ZipArchive finds a deflate64 entry, it will create a new DeflateManagedStream instead of a DeflateStream.
picenka21
pushed a commit
to picenka21/runtime
that referenced
this pull request
Feb 18, 2022
…te64_2 Add managed Deflate64 support to ZipArchive Commit migrated from dotnet/corefx@6e7e7eb
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds back the old managed Deflate implementation and makes it compatible with the Deflate64 algorithm. ZipArchive is modified to use this managed Deflate64 stream whenever it detects an entry compressed using it. This doesn't add any compression support, only decompression, and an archive entry opened in Update mode will be written back using Deflate, not Deflate64.
This resolves the errors we've been seeing lately around windows zips >2gb throwing exceptions. resolves
https://github.com/dotnet/corefx/issues/9925. Progress towards https://github.com/dotnet/corefx/issues/6602.
Tests coming in another PR where I'll also update the TestData version. I'll be waiting to merge this PR until that one is complete, but this one is big enough already.
@stephentoub