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

Fixed reading files larger than 2GB with HttpFile #71

Merged
merged 3 commits into from
Sep 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
188 changes: 0 additions & 188 deletions src/Internal/LazySeekStream.cs

This file was deleted.

7 changes: 7 additions & 0 deletions src/OwlCore.Storage.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
<PackageIcon>logo.png</PackageIcon>
<PackageReleaseNotes>
--- 0.12.0 ---
[Breaking]
The Stream opened from HttpFile is no longer seekable, as the internal LazySeekStream and all usages have been removed.

[Fixes]
Fixes an issue where files larger than 2GB couldn't be fully read via HttpFile.

--- 0.11.3 ---
[Improvement]
Removed redundant validation when enumerating files and folders to improve performance in SystemFile and SystemFolder.
Expand Down
5 changes: 2 additions & 3 deletions src/System/Net/Http/HttpFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,9 @@ public async Task<Stream> OpenStreamAsync(FileAccess accessMode = FileAccess.Rea
// Extract the content length if available
long? length = response.Content.Headers.ContentLength;

if (length is long notNullLength)
if (length is { } notNullLength)
contentStream = new LengthOverrideStream(contentStream, notNullLength);

// Return in a lazy seek-able wrapper.
return new LazySeekStream(contentStream);
return contentStream;
}
}
Loading