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

Let targz type conversions support multi-stream gzip #1493

Merged
merged 2 commits into from
Nov 29, 2023

Conversation

zyfjeff
Copy link
Contributor

@zyfjeff zyfjeff commented Nov 25, 2023

Details

    Let targz type conversions support multi-stream gzip
    
    code reference https://github.com/madler/zlib/blob/master/examples/zran.c
    
    at present, zran and normal targz do not consider the support for
    multi-stream gzip when decompressing, so there will be problems when encountering
    this kind of image, and this PR is used to support the multi-stream gzip format.
 

Types of changes

What types of changes does your PullRequest introduce? Put an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation Update (if none of the other choices apply)

Checklist

Go over all the following points, and put an x in all the boxes that apply.

  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

@zyfjeff zyfjeff requested a review from a team as a code owner November 25, 2023 15:36
@zyfjeff zyfjeff requested review from liubogithub, luodw and hsiangkao and removed request for a team November 25, 2023 15:36
Copy link

codecov bot commented Nov 25, 2023

Codecov Report

Merging #1493 (806585d) into master (0916979) will increase coverage by 0.04%.
The diff coverage is 85.57%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1493      +/-   ##
==========================================
+ Coverage   62.71%   62.75%   +0.04%     
==========================================
  Files         123      123              
  Lines       43248    43340      +92     
  Branches    43248    43340      +92     
==========================================
+ Hits        27122    27199      +77     
- Misses      14817    14827      +10     
- Partials     1309     1314       +5     
Files Coverage Δ
utils/src/compress/mod.rs 97.83% <100.00%> (ø)
utils/src/compress/zlib_random.rs 91.03% <85.29%> (-0.84%) ⬇️

... and 2 files with indirect coverage changes

@zyfjeff zyfjeff changed the title Let targz type conversions support bgzip format Let targz type conversions support multi-stream gzip Nov 26, 2023
@jiangliu
Copy link
Collaborator

Otherwise LGTM!

@imeoer
Copy link
Collaborator

imeoer commented Nov 29, 2023

A merge commit needs to be removed.

@zyfjeff zyfjeff force-pushed the fix-bgzip branch 2 times, most recently from 6d47a48 to 4363308 Compare November 29, 2023 03:56
zyfjeff and others added 2 commits November 29, 2023 12:00
code reference https://github.com/madler/zlib/blob/master/examples/zran.c

at present, zran and normal targz do not consider the support for
multi stream gzip when decompressing, so there will be problems
when encountering this kind of image, and this PR is used to
support the gzip multi-stream.

Signed-off-by: zyfjeff <[email protected]>
// The input does not have a complete trailer.
return Err(eio!("the input does not have a complete gzip trailer"));
}
// Use inflate to skip the gzip header and resume the raw inflate there.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about separate out it as a helper?

@jiangliu jiangliu merged commit 96f402b into dragonflyoss:master Nov 29, 2023
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants