On Wed, Jun 13, 2012 at 05:32:24PM +0200, Denys Vlasenko wrote:
> On Thu, Jun 7, 2012 at 3:30 PM, John Spencer
> <[email protected]> wrote:
> > in gnu wget, it is not important if you place --options before or after the
> > url, but bb wget fails.
>
> Are you sure?
I thought this made sense (behavior based on the underlying getopt)
until I realized BB isn't using getopt for most things...
> > another broken thing in busybox wget is the -c switch which should enable
> > resuming of incomplete downloads, but when this option is used with a server
> > that doesnt support REST it will fail to download at all. iirc this happened
> > with the zlib.net server.
>
> Proposed fix:
>
> [...]
> +static void reset_beg_range_to_zero(void)
> +{
> + //bb_error_msg("restart failed");
> + G.beg_range = 0;
> + xlseek(G.output_fd, 0, SEEK_SET);
> + ftruncate(G.output_fd, 0);
This behavior is highly undesirable; if for example you have 99% of a
1gb file downloaded, this will truncate it (against the user's wishes
and expectation). It would be much nicer to just start overwriting in
place so that the original is not lost (assuming the contents are the
same). Then if the user sees that the file started over (failed to
resume), he/she can try looking for a different site with the same
file that does support resume.
Rich
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox