-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Limit redundant work in HTTP fetcher
Where possible, redundant in-memory buffering and hashing of downloaded data is avoided in the HTTP fetcher In order for these things to be avoided two conditions must be met: 1. The REAPI client must provide the expected checksum of the data being requested 2. The HTTP response must include the length of the content being downloaded If the checksum is missing, the file being downloaded must be fetched and buffered in memory so that the checksum can be determined (despite the fact that it will end up being hashed again later). If only the length is missing, the file being downloaded will still be fetched an buffered in memory in its entirety, but the calculation of the checksum can be skipped. Otherwise, the body of the HTTP response is used to create an internal buffer directly, leading to it being fetched in a more sensible way as it is being written to the underlying storage.
- Loading branch information
1 parent
00658e8
commit d7a9200
Showing
2 changed files
with
140 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters