Bug 21042 - wget reports incorrect file sizes
wget reports incorrect file sizes
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: wget (Show other bugs)
6.2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-11-18 01:22 EST by Binand Sethumadhavan
Modified: 2014-03-16 22:17 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-11-18 01:23:01 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Binand Sethumadhavan 2000-11-18 01:22:59 EST
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 18:49:30 EST
This appears to be fixed in wget-1.6-1, currently in rawhide.

Note You need to log in before you can comment on or make changes to this bug.