-
Notifications
You must be signed in to change notification settings - Fork 1.5k
libc/stream,lzf: add lzf decompress stream and fix lzf-stream header/seek/read issues #18281
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
Open
W-M-R
wants to merge
6
commits into
apache:master
Choose a base branch
from
W-M-R:stream
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or 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
Signed-off-by: wangmingrong1 <[email protected]>
Signed-off-by: wangmingrong1 <[email protected]>
Align sistream and sostream structures so they use the same lib_stream_seek macro Signed-off-by: wangmingrong1 <[email protected]>
Fixed the issue that loop reading without buffer offset would cause data read errors Signed-off-by: wangmingrong1 <[email protected]>
This lib_lzfinstream supports seeking uncompressed files. It can seek backward, but if it seeks forward, the internal implementation will search from the beginning. examples: struct lib_filesistream_s rawstream; struct lib_lzfsistream_s lzfstream; lib_rawoutstream(&rawstream, fd); lib_lzfoutstream(&lzfstream, &rawstream); Signed-off-by: wangmingrong1 <[email protected]>
…ession issues with lzf-stream. LZF compression will have two types of headers: one indicating successful compression and one indicating failed compression. Signed-off-by: wangmingrong1 <[email protected]>
Contributor
|
Hi @W-M-R Please provide more detailed testing information |
linguini1
requested changes
Jan 30, 2026
Contributor
linguini1
left a comment
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.
Requires more than just a CI test
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
Note: Please adhere to Contributing Guidelines.
Summary
Added lib_lzfinstream (LZF decompression input stream), supporting seek operations on "decompressed data": backward processing is possible, while forward scanning reconstructs the state from the beginning.
Aligned sistream/sostream structures to allow them to reuse the same lib_stream_seek macros/interfaces, avoiding type inconsistency issues.
Fixed errors in the loop read offset/buffer handling of file(s)istream, preventing read errors when there is no buffer offset.
Fixed the handling of lzf-stream in both "compression successful" and "compression failed" header scenarios: preventing decompression errors caused by parsing according to the compressed block format when compression fails, and reducing the risk of potential compression failure/decompression errors.
Impact
Provides stream-based LZF decompression capabilities, facilitating on-demand reading in file/storage scenarios and supporting location-based reading of uncompressed views.
Improves stream system consistency (sistream/sostream alignment) and stability (type errors, read offset errors, LZF header branch handling).
The changes primarily focus on libc/stream and LZF-related implementations and are not expected to affect modules that do not use these streams/algorithms.
Testing
ci test