Discussion:
[Bug-wget] [bug #54963] wget -c treats a 416 response as a failure
Svein Ove Aas
2018-11-05 15:39:52 UTC
Permalink
URL:
<https://savannah.gnu.org/bugs/?54963>

Summary: wget -c treats a 416 response as a failure
Project: GNU Wget
Submitted by: baughn
Submitted on: Mon 05 Nov 2018 03:39:50 PM UTC
Category: Protocol Issue
Severity: 3 - Normal
Priority: 5 - Normal
Status: None
Privacy: Public
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: 1.19.5
Operating System: None
Reproducibility: Every Time
Fixed Release: None
Planned Release: None
Regression: Yes
Work Required: None
Patch Included: None

_______________________________________________________

Details:

This was tested on NixOS 19.03pre-git (Koi), based on a report from a user on
Windows.

With wget -c, the client issues a range request asking for any data that has
not yet been downloaded. For a file that has already been fully downloaded
this becomes an invalid request, asking for data that does not exist, and the
HTTP server should return a 416.

In wget 1.18, the 416 return is correctly treated as success.

For wget 1.19.5, this is treated as an error, and the download is retried. It
should be treated as success.

Example, for `wget -d -c -t 1 https://brage.info/robots.txt`:
https://brage.info/wget-bug.txt




_______________________________________________________

Reply to this item at:

<https://savannah.gnu.org/bugs/?54963>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
Svein Ove Aas
2018-11-05 15:59:38 UTC
Permalink
Follow-up Comment #1, bug #54963 (project wget):

To clarify: *This specific* 416 should be treated as success, not every 416
issued for a range request. Specifically, the HTTP return includes the size of
the file on disk, matching the size wget knows it already has.

_______________________________________________________

Reply to this item at:

<https://savannah.gnu.org/bugs/?54963>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
Tim Ruehsen
2018-11-06 09:04:25 UTC
Permalink
Update of bug #54963 (project wget):

Assigned to: None => rockdaboot

_______________________________________________________

Follow-up Comment #2:

robots.txt is an exception regarding 416 responses. It will always be fully
retrieved (have to find the reason in the ML archives yet).

Try the same with
`wget -d -c -t 1 https://brage.info/wget-bug.txt`
and you'll see

"The file is already fully retrieved; nothing to do."

But this exception seems not to be documented... I leave this open until the
docs have been updated.

Thanks for the report.

_______________________________________________________

Reply to this item at:

<https://savannah.gnu.org/bugs/?54963>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
Tim Ruehsen
2018-11-06 09:34:25 UTC
Permalink
Update of bug #54963 (project wget):

Status: None => Confirmed

_______________________________________________________

Follow-up Comment #3:

Sorry, I have to correct myself.

You are right, it is a regression introduced in 1.19.2 (commit 6f3b99599).

_______________________________________________________

Reply to this item at:

<https://savannah.gnu.org/bugs/?54963>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
Tim Ruehsen
2018-11-09 15:22:44 UTC
Permalink
Update of bug #54963 (project wget):

Open/Closed: Open => Closed
Release: 1.19.5 => 1.19.2
Planned Release: None => 1.19.6

_______________________________________________________

Follow-up Comment #4:

The commit has been reverted. Thanks for reporting.

_______________________________________________________

Reply to this item at:

<https://savannah.gnu.org/bugs/?54963>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Loading...