bugGNU Wget - Bugs: bug #24948, Progress bar displays incorrectly...

 
 

bug #24948: Progress bar displays incorrectly if using -c on a non-resumable source.

Submitted by:  Adam Buchbinder <adambuchbinder>
Submitted on:  Wed 26 Nov 2008 08:24:49 PM UTC  
 
Category: User InterfaceSeverity: 3 - Normal
Priority: 9 - ImmediateStatus: Fixed
Privacy: PublicAssigned to: Saint Xavier <sxav>
Originator Name: Adam BuchbinderOpen/Closed: Closed
Release: trunkOperating System: GNU/Linux
Reproducibility: Every TimeFixed Release: 1.12
Planned Release: 1.12Regression: None
Work Required: 0 - HoursPatch Included: Yes

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 16 Jun 2009 06:34:50 AM UTC, comment #3:

So, the main problem with this patch is that the progress length, though it now displays the correct percentage at the end, also claims to have downloaded a larger file than it actually did.

Here's the fix I've opted for:

Fixed in 82aaf21fbdca

Micah Cowan <micahcowan>
Thu 27 Nov 2008 12:22:47 PM UTC, comment #2:

In retr.c:fd_read_body() around line 226, progress is created from "0" if we skip some data.
In progress.c:create_image() or progress.c:dot_create() initial length is used to print the already downloaded part. Passing "0" in case of skipped data leads to an incorrect display.

How to reproduce:
wget -O orig 'http://cr.yp.to/papers.html'
rm -f papers.html && dd if=orig of=papers.html count=30 && wget -c 'http://cr.yp.to/papers.html'

I'm not sure it is a duplicate of bug 22403.

Patch attached.

(file #16930)

Saint Xavier <sxav>In charge of this item.
Thu 27 Nov 2008 06:27:54 AM UTC, comment #1:

Possibly a dupe of bug 22403?

Micah Cowan <micahcowan>
Wed 26 Nov 2008 08:24:49 PM UTC, original submission:

I'm running the following wget, pulled from Hg today and compiled on Ubuntu Intrepid:

$ ../wget/src/wget --version
GNU Wget 1.12-devel (bb58048a2b58)
Options : +digest +ipv6 +nls +ntlm +opie +md5/openssl -gnutls
+openssl +gettext
Wgetrc : /usr/local/etc/wgetrc (system)
Locale : /usr/local/share/locale
Compile : gcc -DHAVE_CONFIG_H
-DSYSTEM_WGETRC="/usr/local/etc/wgetrc"
-DLOCALEDIR="/usr/local/share/locale" -I. -I../lib -g -O2
Link : gcc -g -O2 -lssl -lcrypto -ldl -lrt ftp-opie.o openssl.o
http-ntlm.o gen-md5.o ../lib/libgnu.a

Find a non-resumable URL, or just funnel requests through Privoxy. (Privoxy disables resuming when any filtering is active.) I'm using http://cr.yp.to/papers.html, but any non-resumable source will work.

First, download a bit of it.

$ ../wget/src/wget -c --limit-rate=30k 'http://cr.yp.to/papers.html'
--2008-11-26 15:20:38-- http://cr.yp.to/papers.html
Resolving cr.yp.to... 131.193.36.21
Connecting to cr.yp.to|131.193.36.21|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 56203 (55K) [text/html]
Saving to: `papers.html'

17% [=====> ] 9,966 30.0K/s

I hit CTRL-C after it was partly downloaded, to get a partial file.

Now, attempt to resume it:

$ ../wget/src/wget -c --limit-rate=30k 'http://cr.yp.to/papers.html'
--2008-11-26 15:20:54-- http://cr.yp.to/papers.html
Resolving cr.yp.to... 131.193.36.21
Connecting to cr.yp.to|131.193.36.21|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 56203 (55K) [text/html]
Saving to: `papers.html'

68% [========================> ] 56,203 30.0K/s in 1.8s

2008-11-26 15:20:56 (30.0 KB/s) - `papers.html' saved [56203/56203]

Note that the progress bar doesn't come out to 100%, even though the file is all there. (It's not corrupted, either.) It seems like the correct filesize isn't being used to calculate the maximum size of the progress bar.

Additionally, if the file is all there, the progress bar will always fill to fifty percent, and complete the file at that point.

I ran into this while testing bug #24940, but it's a separate issue.

Adam Buchbinder <adambuchbinder>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #16930:  bug24948_fix.patch added by sxav (1KiB - application/octet-stream - Fix progress display)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by sxav (Updated the item)
  • -unavailable- added by micahcowan (Posted a comment)
  • -unavailable- added by adambuchbinder (Submitted the item)
  •  

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 12 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 16 Jun 2009 06:34:50 AM UTCmicahcowanStatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
      Fixed ReleaseNone=>1.12
    Mon 01 Dec 2008 09:57:09 PM UTCmicahcowanPriority4=>9 - Immediate
    Thu 27 Nov 2008 12:22:47 PM UTCsxavAttached File-=>Added bug24948_fix.patch, #16930
      StatusNeeds Investigation=>Ready For Test
      Assigned toNone=>sxav
      Work RequiredNone=>0 - Hours
      Patch IncludedNone=>Yes
    Thu 27 Nov 2008 06:27:54 AM UTCmicahcowanPriority5 - Normal=>4
      StatusNone=>Needs Investigation
      Planned ReleaseNone=>1.12

    Back to the top


    Powered by Savane 3.1-cleanup1