Bug 21042

Summary: wget reports incorrect file sizes
Product: [Retired] Red Hat Linux Reporter: Binand Sethumadhavan <binand>
Component: wgetAssignee: Bill Nottingham <notting>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2CC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-11-18 06:23:01 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Binand Sethumadhavan 2000-11-18 06:22:59 UTC
Typical scenario:

I start wget as wget -b URL. The connection breaks in between, and I restart the download as wget -c -b URL. In this case, the file sizes reported by wget are all wrong.

Here are the relevant log file entries:

1. Initial wget (wget -b URL)
--16:17:29-- 
 ftp://ftp.sonic.net:21/pub/linux/kde/kdevelop/kdevelop-1.2-1.src.rpm  
     => `kdevelop-1.2-1.src.rpm'
Connecting to ftp.sonic.net:21... connected!
Logging in as anonymous ... Logged in!
==> TYPE I ... done.  ==> CWD pub/linux/kde/kdevelop ... done.
==> PORT ... done.    ==> RETR kdevelop-1.2-1.src.rpm ... done.
Length: 8,107,130 (unauthoritative)

    0K -> .......... .......... .......... .......... .......... [  0%]
<rest snipped>

The file size is reported correctly as approx. 7.7 MB.

This was terminated at about 3.4 MB. Here is the ls listing then:
-rw-r--r--   1 binand   users     3545944 Nov 16 17:34 kdevelop-1.2-1.src.rpm

So I restart wget with wget -b -c URL, and this is what is logged:

--10:51:41--  
ftp://ftp.sonic.net:21/pub/linux/kde/kdevelop/kdevelop-1.2-1.src.rpm
     => `kdevelop-1.2-1.src.rpm'
Connecting to ftp.sonic.net:21... connected!
Logging in as anonymous ... Logged in!
==> TYPE I ... done.  ==> CWD pub/linux/kde/kdevelop ... done.
==> PORT ... done.    ==> REST 3545944 ... done.    
==> RETR kdevelop-1.2-1.src.rpm ... done.
Length: 4,561,186 [1,015,242 to go] (unauthoritative)

          [ skipping 3450K ]
 3450K -> ,,,,,,,,,, ,,........ .......... .......... .......... [ 78%]

The REST command reports the correct size, but now the Length: field in the log is incorrect. What it says as length is actually the 'to go' field. I suspect the current size is subtracted twice from the actual file size reported by the FTP SIZE command.

Towards the end of this log file, I see:
 7900K -> .......... .......                                     [177%]

11:30:48 (1.92 KB/s) - `kdevelop-1.2-1.src.rpm' saved [8107130]

That is, wget downloaded 77% more than what is required :-)

The file is downloaded correctly, though. No problem there. The problem is only in the numbers that wget logs.

Comment 1 Bill Nottingham 2001-01-30 23:49:30 UTC
This appears to be fixed in wget-1.6-1, currently in rawhide.