Closed grncdr closed 10 years ago
fair warning: I haven't run any of the tests yet. Just seeing how it looks. If the design isn't too horrible (it nearly doubles the code size :frowning:), I will see about adding another test for it.
@grncdr I read through the diffs, this looks really good so far!
Cool, I added a test and figured out I was doing something slightly wrong. I was assuming that content-length
should refer to the length of the entire entity, but it turns out that it should always reflect just the payload for the current request. The test is correct afaict, but I should probably do some manual testing against an nginx or apache server just to make sure my test server isn't doing something wrong.
Ok, I've tested this against a local nginx by killing a download partway through and then resuming it and everything works (the md5 matches for original file and downloaded files).
This implements resumable downloads by attempting to use range requests when the target file already exists.
Range
header.