[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-wget] bug in socket reuse when using wget -c

From: Darshit Shah
Subject: Re: [Bug-wget] bug in socket reuse when using wget -c
Date: Fri, 8 Dec 2017 18:47:16 +0100
User-agent: NeoMutt/20171027-97-6d60e3


Thanks for your report. It is indeed a bug in Wget, as you've rightfully
investigated. The socket still had some data which caused the next request to
have problems.

I've attached two patches here, the first one fixes the issue. It tries to read
and discard any HTTP body still available and then re-use the socket. The
second patch adds a test case for this scenario

* Iru Cai <address@hidden> [171208 17:19]:
> Hello wget developers,
> I found an issue when using `wget -c`, as in:
>   https://github.com/mholt/caddy/issues/1965#issuecomment-349220927
> By checking out the wget source code, I can confirm that it doesn't
> drain the response body when it meets a 416 Requested Range Not
> Satisfiable, and then the socket will be reused for the second request
> (http get 2.dat in this case). When parse its response, it will
> encounter the first response's body, so it failed to get the correct
> response header. This is why you get a blank response header.
> Hope this can be fixed.
> Thanks,
> Iru

Thanking You,
Darshit Shah
PGP Fingerprint: 7845 120B 07CB D8D6 ECE5 FF2B 2A17 43ED A91A 35B6

Attachment: 0001-Don-t-assume-a-416-response-has-no-body.patch
Description: Text document

Attachment: 0002-Add-new-test-for-416-responses.patch
Description: Text document

Attachment: signature.asc
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]