|
From: | anonymous |
Subject: | [Bug-wget] [bug #51840] Local file corruption using default retry mechanism when retry returns no data |
Date: | Thu, 24 Aug 2017 11:13:31 -0400 (EDT) |
User-agent: | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36 |
URL: <http://savannah.gnu.org/bugs/?51840> Summary: Local file corruption using default retry mechanism when retry returns no data Project: GNU Wget Submitted by: None Submitted on: 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: address@hidden Open/Closed: Open Discussion Lock: Any Release: 1.18 Operating System: GNU/Linux Reproducibility: Every Time Fixed Release: None Planned Release: None Regression: None Work Required: None Patch Included: None _______________________________________________________ Details: 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. _______________________________________________________ File Attachments: ------------------------------------------------------- Date: Thu 24 Aug 2017 03:13:30 PM UTC Name: wget118_corruption.pcap Size: 3KiB By: None <http://savannah.gnu.org/bugs/download.php?file_id=41642> ------------------------------------------------------- Date: Thu 24 Aug 2017 03:13:30 PM UTC Name: wget_debug.log Size: 3KiB By: None <http://savannah.gnu.org/bugs/download.php?file_id=41643> _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?51840> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/
[Prev in Thread] | Current Thread | [Next in Thread] |