Hacker News new | ask | show | jobs
by hmpc 3760 days ago
Actually no. From the manpage:

Use "-C -" to tell curl to automatically find out where/how to resume the transfer. It then uses the given output/input files to figure that out.

2 comments

Stupid question, but how do things like this resume from where they left off? Wouldn't the server need to be cooperating in this? Is that build into HTTP?
Yes the server would need to support it. The request is made via a HTTP header (Range[1] IIRC).

Also, I wouldn't consider that a stupid question. :)

[1] https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#Rang...

This is also how download accelerators worked (back in the late nineties, early naught's), by having different connections work at several ranges to maximize bandwidth usage.
Funny enough, it was writing a download accelerator that taught me about the Range HTTP request header.
You specify a byte "range" when requesting a file via HTTP from the server. Not all servers support this, but most do these days.

#Edit. More info here: https://en.wikipedia.org/wiki/Byte_serving

Just looked that up, that's a rather limited usefulness. The multi homed usage makes sense but feels out of place really.
Why? How could it be more useful? HTTP byte ranges are incredibly flexible, since you one request can specify many byte ranges at once (it's almost too flexible, since a dumb server can easily be overwhelmed by a maliciously complicated request)

It handles the basic case of fetching the remainder of an interrupted download, and can also support partial downloads e.g. for supporting a video stream with the user jumping to different places in the movie.

Correct, but very unintuitive
Also doesn't work with the command line utility's retry option as it gets the size only once and does not update it when retrying.