servo/components/net
bors-servo 1343c7de50
Auto merge of #21560 - JacksonCoder:chunk-file, r=jdm
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 -->
2018-09-06 19:52:16 -04:00
..
fetch Tidy things up 2018-09-06 16:09:35 -07:00
tests Ensure done_chan is Some, when refreshing a still receiving resource 2018-06-23 16:49:50 +08:00
blob_loader.rs Remove unused part of the return value of parse_blob_url(). 2017-01-30 15:16:27 +01:00
Cargo.toml Auto merge of #21386 - Eijebong:remove-websocket, r=jdm 2018-08-15 14:54:32 -04:00
connector.rs Handle secure websockets 2018-08-16 00:24:19 +02:00
cookie.rs Implement secure and host cookie prefixes 2017-11-21 19:15:58 -08:00
cookie_storage.rs Replace a boxed iterator with impl Trait 2018-05-11 09:12:11 -07:00
data_loader.rs Replace use of rustc_serialize::base64 by base64 2017-03-26 14:15:31 +02:00
filemanager_thread.rs move top_level_browsing_context_id out of embedder msg 2018-05-23 21:46:05 +08:00
hosts.rs Replace parse-hosts crate with 10 lines of code. 2017-11-28 16:19:29 +01:00
hsts.rs delegate resource reading to embedder 2018-04-27 15:34:52 +08:00
http_cache.rs Ensure done_chan is Some, when refreshing a still receiving resource 2018-06-23 16:49:50 +08:00
http_loader.rs Network: Preserve HEAD on 303 redirect 2018-08-19 03:14:34 +08:00
image_cache.rs Update WR (transaction API change) 2018-06-20 09:15:31 +10:00
lib.rs Replace servo-websocket by ws 2018-08-15 16:53:48 +02:00
mime_classifier.rs Fix commonmark Markdown warnings in docs, part 1 2017-10-17 11:24:57 -07:00
resource_thread.rs move msg to embedder_traits, use in script, handle send error in embedder 2018-05-23 21:45:57 +08:00
storage_thread.rs Save local storage at every change and not just on shutdown 2018-05-20 12:15:02 -07:00
subresource_integrity.rs Fix commonmark Markdown warnings in docs, part 1 2017-10-17 11:24:57 -07:00
websocket_loader.rs The WS protocols should be case sensitive, not insensitive 2018-08-16 15:50:50 +02:00