-
Notifications
You must be signed in to change notification settings - Fork 976
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
Broken GZip header since version 1.2 #393
Comments
same as #382 ? |
Looks like it. I'm wondering if we have two issues:
|
That's what seemed to be happening with TarArchive (there seem to be situations where disposing the archive causes it to flush the output stream that hasn't yet been written to, and to write all the data into the stream after that), not sure if using TarOutputStream directly is exactyl the same ror a variation. |
This is probably because of the forced flush of the deflate engine. It's not supposed to work with an empty buffer. I think we need to rethink the DeflaterOutputStream flushing. What we are doing now is forcing the state machine to run even though it's not requesting data. The purpose was to make sure all buffers were flushed when the files were closed, but if it's not in a state that accepts more data, it's not doing anything useful anyway... |
should be fixed in 1.3.0? |
It should. Please create a new ticket if this is still a problem. |
Steps to reproduce
Expected behavior
The GZip file should always start with the magic header 0x1f, 0x8b.
Otherwise it can't be opened with most gz compatible applications.
Actual behavior
The GZip file starts with the following bytes (up to and including the magic header):
If you strip away the "garbage" (first 30 bytes), the file seems to be correct.
Version of SharpZipLib
1.2.0
Running under .NET Core 3.0 (final)
Obtained from
Test code
Remark: this is stripped down production code, so please don't judge it ;-)
The text was updated successfully, but these errors were encountered: