mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-03 21:23:38 +00:00
When using ZipReader to read a streamed zip file, MoveToNextEntry skipping doesn't work properly #531
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @AlexVallat on GitHub (Jul 19, 2022).
If using ZipReader to read a streamed zip file (using PostDataDescriptor) then using MoveToNextEntry to skip an entry does not work properly. I think this is because AbstractReader.Skip always sets
filePart.Skipped = truec73a8cb18f/src/SharpCompress/Readers/AbstractReader.cs (L135)even if the entry size is not known and so it has to decompress to skip.Minimal repro:
test.zip
When run, after the first entry, the next MoveToNextEntry returns false even though there are further entries.
If you uncomment the
reader.OpenEntryStream().Dispose();line then this has the same effect of skipping the entry, but without setting filePart.Skipped true, and all the entries are listed.@AlexVallat commented on GitHub (Jul 19, 2022):
Note, this is a regression from 0.32.0 to 0.32.1. Probably due to https://github.com/adamhathcock/sharpcompress/pull/672 ?
@adamhathcock commented on GitHub (Jul 26, 2022):
You're right that PR broke this. Might have to revert.
Discussion here: https://github.com/adamhathcock/sharpcompress/issues/477
@Erior commented on GitHub (Aug 4, 2022):
I think this should be closed
@adamhathcock commented on GitHub (Aug 5, 2022):
Yup. 0.32.2 fixed this I believe