probonopd / zsync-curl

Partial/differential file download client over HTTP(S)
109 stars 23 forks source link

Dumps target file to stdout #6

Closed probonopd closed 6 years ago

probonopd commented 8 years ago

We are currently using range 0-0 to find out the final redirected URL of the payload file. However, if the server does not support range requests, then this fails and the full file is dumped to the command line instead.

Bintray, for example, uses Amazon CloudFront and redirects there. However, shortly after uploading a file it is not available on CloudFront yet and during that time, Bintray doesn't redirect to CloudFront.

In this case, the file is dumped to stdout, which must be prevented.

The issue is located in the source code here: https://github.com/probonopd/zsync-curl/blob/master/src/client.c#L312-L317

probonopd commented 8 years ago

The following works: curl https://dl.bintray.com/probono/AppImages/Leafpad-0.8.17-x86_64.AppImage -w '%{redirect_url}' - TODO: check with the curl source code how this is implemented and use it.

However this does not follow multiple redirects automatically, so we must wrap this in a loop that ends once the url and the redirect url are the same.

TheAssassin commented 6 years ago

Please switch to zsync2, and report bugs there if you find some. Closing as this repository is no longer developed.