mirror of
https://github.com/servo/servo.git
synced 2025-06-20 23:28:59 +01:00
Read file URL in chunks <!-- Please describe your changes on the following line: --> This is a very straightforward PR: essentially, I replaced a `read_to_end` call that occurs when processing a file URL fetch with a loop that reads the file in chunks (with a `FILE_CHUNK_SIZE` constant that specifies the chunk size, which I've put at 32KB), and then calls `target.process_response_chunk` to process the chunk. The chunk is then appended to the fetch result, and once the end of the file is reached, the result is returned. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #21466. <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because there isn't really a way to observe this. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21560) <!-- Reviewable:end --> |
||
---|---|---|
.. | ||
fetch | ||
tests | ||
blob_loader.rs | ||
Cargo.toml | ||
connector.rs | ||
cookie.rs | ||
cookie_storage.rs | ||
data_loader.rs | ||
filemanager_thread.rs | ||
hosts.rs | ||
hsts.rs | ||
http_cache.rs | ||
http_loader.rs | ||
image_cache.rs | ||
lib.rs | ||
mime_classifier.rs | ||
resource_thread.rs | ||
storage_thread.rs | ||
subresource_integrity.rs | ||
websocket_loader.rs |