Skip to content

Teach hyper/rustls HTTP backends to resume partial downloads#1192

Closed
ghost wants to merge 3 commits intomasterfrom
unknown repository
Closed

Teach hyper/rustls HTTP backends to resume partial downloads#1192
ghost wants to merge 3 commits intomasterfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Jul 3, 2017

This PR Fixes #1181

Copy link
Copy Markdown
Contributor

@seanmonstar seanmonstar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A request with a Range header will return a PartialContent (a 206), so this needs to be updated to handle that status.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@seanmonstar thanks, I'll address this then :)

Could you give me more information about how to write the tests you mentioned?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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...

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see then

Lucas Teixeira added 2 commits July 20, 2017 20:41
@ghost
Copy link
Copy Markdown
Author

ghost commented Jul 21, 2017

@seanmonstar I addressed the things you mentioned and added two new commits.
I can squash them whenever this PR gets merged.

But for some reason AppVeyor keeps failing. From a quick search online, it appears the reason is a failure to verify a CA certificate.

@alexcrichton
Copy link
Copy Markdown
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants