cURL / Mailing Lists / curl-users / Single Mail

curl-users

Behaviour of --continue

From: Stenberg Björn <Bjorn.Stenberg_at_elema.siemens.se>
Date: Thu, 28 Sep 2000 14:13:39 +0200

I've filed a bug report (#114811) about the behaviour of --continue, and
Daniel wants some suggestions. Rather than discussing this in the bug report
form, I present the issue here for open discussion.

My bug report:
--------------
When fetching a file with the --continue parameter, I get a confusing
progress display. It shows as if the file is being fetched from byte 0. If
that is so, there should be a warning (and possibly an option to bail out).
If not, the "continue" status should be visible, i.e. show how much of the
file has been (previously) transferred and accurately show how much is left.

Daniel's response:
------------------
Any suggestions/source snippets on how the display could be improved to show
this in a nice manner?

My opinion:
-----------
I have two options to suggest as for the display:

A) (the fancy option)
The display should look the same as if we'd transferred all the data in one
session. That is, the "received bytes" counter should bump up to the size of
the file. The time counters should, however, not be bumped. They should
start from zero.
I realize this breaks the "true" meaning of "received bytes", but I think it
is more intuitive this way. I also realize this will probably screw up the
speed calculation (which should show the speed of the current transfer,
excluding "previous data").

B) (the simple option)
At the start of the --continue'd transfer, a single line is printed saying:
*** Continuing from byte 61023232
...and then the display shows the remaining download as if it was a separate
file. I.e. the remaining 5 MB of a 60 MB file is shown as if a 5 MB file was
downloaded.

Regardless of above options:

If the --continue is "unsuccessful", in so that the server does not support
partial file transfer and we are not getting the data we requested, the
operation should be aborted and curl should exit without touching the output
file.
The reason for this is simple: Suppose I am downloading a 65 MB file over my
14k4 modem, but gets disconnected after 60 MB. When I run curl --continue, I
want to get the remaining 5 MB. If that's not possible, I do not want to
restart the full 65 MB download and I definitely do not want my precious 60
MB file to be truncated and/or overwritten. (If I really wanted that, I
wouldn't have specified --continue.)
I actually don't know how curl does this today. Maybe it's working this way
already, only the display confused me...

-- 
Björn Stenberg
mailto:bjorn_at_haxx.se
http://bjorn.haxx.se
Received on 2000-09-28