Teach hyper/rustls HTTP backends to resume partial downloads#1192
Conversation
seanmonstar
left a comment
There was a problem hiding this comment.
This would also need to update the supports_partial_download to return true for these backends (if all are true, is the function even still needed?).
It'd probably be a good idea to add to the tests of the download crate, though it would need a server to serve a file for hyper to download, since the current tests use curl's ability to "download" from a file:// url.
|
|
||
| let mut res = try!(req.send() | ||
| .chain_err(|| "failed to make network request")); | ||
| if res.status != self::hyper::Ok { |
There was a problem hiding this comment.
A request with a Range header will return a PartialContent (a 206), so this needs to be updated to handle that status.
There was a problem hiding this comment.
@seanmonstar thanks, I'll address this then :)
Could you give me more information about how to write the tests you mentioned?
There was a problem hiding this comment.
Writing the tests will be tricky. It'd require starting up an HTTP server and serving partial contents of a file. The currently depended on version of hyper doesn't allow servers to be torn down when the test is done. It might need to wait for an upgrade to that...
All backends support partial downloads now.
|
@seanmonstar I addressed the things you mentioned and added two new commits. But for some reason AppVeyor keeps failing. From a quick search online, it appears the reason is a failure to verify a CA certificate. |
|
Thanks for the PR and sorry for the delay in getting to this! I'm going to close this in favor of #1222 which moves to reqwuest |
This PR Fixes #1181