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

Support downloading manifests/chunks with missing Content-Length #1406

Merged
merged 2 commits into from
Aug 26, 2024

Conversation

xPaw
Copy link
Member

@xPaw xPaw commented Aug 26, 2024

Chunks require CompressedLength to be set, which it should be.

@xPaw xPaw added this to the 3.0.0 milestone Aug 26, 2024
@xPaw xPaw requested a review from yaakov-h August 26, 2024 10:22
{
throw new InvalidDataException( $"Length mismatch after downloading depot manifest! (was {ms.Position}, but should be {contentLength})" );
var data = await response.Content.ReadAsByteArrayAsync();
Copy link
Member

Choose a reason for hiding this comment

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

Are we avoiding ReadAsStreamAsync because we need to be able to seek?

Copy link
Member Author

Choose a reason for hiding this comment

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

ZipArchive(Stream) is a lie because it will copy the stream into an internal MemoryStream if stream is not seekable: https://source.dot.net/#System.IO.Compression/System/IO/Compression/ZipArchive.cs,138

Copy link
Member

Choose a reason for hiding this comment

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

lol

@xPaw xPaw merged commit eee6330 into master Aug 26, 2024
15 checks passed
@xPaw xPaw deleted the content-length-fallback branch August 26, 2024 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants