bug/feature in progress?
Date: Mon, 19 May 2003 10:10:11 -0700
I've been using curl for all of 3 days, so I hope I'm using the right list
and asking appropriate questions.
I think I found a bug in the progress info displayed by lib/progress.c.
Here's what I do.
$ ./curl http://www.gnu.org/manual/emacs-21.2/ps/emacs.ps.gz -O --limit-rate
10k --continue-at -
where ./curl is the binary I built by hand on my Win XP box from 7.10.4
$ ./curl -V
curl 7.10.4 (win32) libcurl/7.10.4
I have cygwin installed and am running from a bash shell, but built curl
using 'make vc'.
What I really do is run the above download command and hit ctrl-c before
it's finished. The first time, when emacs.ps.gz isn't a file on my local
file system, the progress info is correct. Something like:
% Total % Received % Xferd Average Speed Time
Dload Upload Total Current Left
6 1005k 6 66058 0 0 9949 0 0:01:43 0:00:06 0:01:36
When I execute the download command again, both the % total and % received
numbers start back from 0 again, even though the file is partially there.
The total number of bytes seems to start at a non-zero number, but that one
seems too big....Anyway, I'm more concerned about the percentage for now.
From looking at the code, it seems like a call to
Curl_pgrsSetDownloadCounter() is needed, or just setting the
data->progress.downloaded field directly. I can't tell if the
CreateConnection function in url.c is the right place -- inserted after line
1852 of rev 1.268 maybe? Or maybe changing the call to
Curl_pgrsSetDownloadCounter in transfer.c (line 1183 of rev 1.143)? Or
maybe this isn't a bug at all and is the way you want it to work.
I see the same kind of 'start-at-0' behavior when using --progress-bar. My
end goal has me writing my own progress function that sends the info to a
remote site, so I want to make sure the info passed to the progress function
I'll try this with 7.10.5 in the meantime, but the release notes don't make
it sound like anything like this has changed.
-- David Byron dbyron_at_everdream.com Everdream http://www.everdream.com 6591 Dumbarton Circle voice:(510)818-5550 Fremont, CA 94555 fax:(510)818-5510 ------------------------------------------------------- This SF.net email is sponsored by: If flattening out C++ or Java code to make your application fit in a relational database is painful, don't do it! Check out ObjectStore. Now part of Progress Software. http://www.objectstore.net/sourceforgeReceived on 2003-05-19