bugGNU Wget - Bugs: bug #51840, Local file corruption using...

 
 

bug #51840: Local file corruption using default retry mechanism when retry returns no data

Submitter:  None
Submitted:  Thu 24 Aug 2017 03:13:30 PM UTC
   
 
Category:  Program Logic Severity:  3 - Normal
Priority:  5 - Normal Status:  None
Privacy:  Public Assigned to:  None
Originator Name:  Andrew Caruth Originator Email:  -email is unavailable-
Open/Closed:  Open Release:  1.18
Operating System:  GNU/Linux Reproducibility:  Every Time
Fixed Release:  None Planned Release:  None
Regression:  None Work Required:  None
Patch Included:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 24 Aug 2017 03:13:30 PM UTC, original submission:  

The following server behaviour results in a corrupt local download:

1: Accept TCP connection from wget
2: Return all of the HTTP response header and N bytes of the content
3: Close the connection
(wget retry attempt 1 begins from offset N using the range header)
4: Accept TCP connection from wget
5: Close the connection
(wget retry attempt 2 begins with no byte range)
6: Return all of the HTTP response header and all of the content
7: Close the connection

The local file will now contain the bytes received in step 2 as well as all of the bytes received in step 6.

I believe that if a 'ranged' retry receives no data, further retries should continue to make ranged requests. Alternatively the offset in the partial file should be reset to 0 so the next non-ranged request starts from the correct place.

I've attached a tcpdump capture and wget debug output. The file requested is 12 bytes ("hello world!") and the resulting file is 17 bytes ("hellohello world!").

I have also reproduced this with wget 1.13.

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #41642:  wget118_corruption.pcap added by None (3KiB - application/octet-stream)
file #41643:  wget_debug.log added by None (3KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by None (Submitted the item)
  •  

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-08-24 None Attached File- Added wget118_corruption.pcap, #41642
        Attached File- Added wget_debug.log, #41643

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code