Skip to content
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

Repaired archive can be incomplete #226

Open
extiop opened this issue Oct 18, 2024 · 0 comments
Open

Repaired archive can be incomplete #226

extiop opened this issue Oct 18, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@extiop
Copy link

extiop commented Oct 18, 2024

The repair action with mlar uses brotli::BrotliDecompressStream in Read impl for CompressionLayerFailSafeReader. While needing more input (brotli::BrotliResult::NeedsMoreInput) brotli can return an output_offset of 0 which is considered as there is no more bytes to read in the current implementation of MLA (compress layer, notably the read()). This is problematic as it can cut some archives before their end.

One workaround is to read again (could be multiple times) but it's only a workaround.

Two possible solutions could be:

  • to check that brotli decompressed nothing with other returned values such as available_out or written as it needs more input, so we continue reading ;
  • patch this behavior in brotli, according to their requirements. This one is preferred as MLA would be totally in line with the spec of Read (https://doc.rust-lang.org/nightly/std/io/trait.Read.html#required-methods) .
@extiop extiop added the bug Something isn't working label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant