Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support resuming downloads. #311

Closed
wants to merge 2 commits into from
Closed

Conversation

idyll
Copy link
Contributor

@idyll idyll commented Jan 20, 2014

This should add the ability to resume the download of both a File and String I/O.

It is based on the HTTP_RANGE object. We use Racks build in range parsing to find the first range and deliver it.

Really, it's not a range - it's just an offset - because I am not stopping the I/O after we hit the end. Hopefully someone with a better understating of Rack can clean that part up.

That being said, it is totally usable - and very useful - right now.

I have tested it with a 5GB file and the md5 of the download matched the md5 of the original file after several restarts in my sample app.

@markevans
Copy link
Owner

thanks - this looks cool. I won't pull it in as-is though I'm afraid as rather than put code into Dragonfly's core I'd have thought this could be done with a Rack middleware? Could be a cleaner solution

@idyll
Copy link
Contributor Author

idyll commented Jan 29, 2014

I agree it could be cleaner - but I actually think it might need deeper integration.

It should be aware of a datastore's ability to deal with download resume and proxy info when going to a 3rd party that supports HTTP_RANGE.

I also think the app should ignore HTTP_RANGE when you've requested a image that needs to be modified before being served.

I think partial downloads should be handled by dragonfly. You're snapped into middleware and directly serve the files already. This just makes sense.

Totally open to suggestions on a better implementation.

@markevans
Copy link
Owner

hi I'm gonna close this for the moment. perhaps it should be revisited in the future but at that time I would expect a more thorough look at streaming would need to be done throughout dragonfly e.g. changing the datastore API too so streaming could be done all the way through. thanks for the request

@markevans markevans closed this Jul 14, 2014
@speedmax speedmax mentioned this pull request Aug 24, 2015
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.

None yet

2 participants