mrkline / piz-rs

Parallelized zip archive reading
zlib License
36 stars 11 forks source link

Use features to control whether to check metadata consistency between file headers and central directory #6

Closed bianyifan closed 3 years ago

bianyifan commented 3 years ago

Some softwares, such as GitLab, may generate zip packages, in which information about file stored in local file header and central directory don't match, e.g. compressed_size and uncompressed_size are 0 in local file headers but correct in central directory.

As per piz is using information from central directory for extraction and information from local file headers are only used for validation, it would be great to have a switch on this behavior.

This PR has utilized a Cargo feature called "features" to control whether enable checking local file headers against central directory during compilation, and users may opt-out checking local metadata by piz = { version = '0.3.1', default-features = false }, or directly piz = '0.3.1' if they want to use the old and default behavior of checking local file headers against central directory.

This PR also updated dependency stderrlog to the latest available version.

mrkline commented 3 years ago

Awesome, thanks! Apologies for the delay; things have been hectic lately.

bianyifan commented 3 years ago

No need to apologize at all :)

Could you push a new version of this package to crates.io? Thanks.

mrkline commented 3 years ago

Done (after much delay)!