[Toybox] [PATCH] wget: cleanup, add support for file disposition and fix HTTP protocol version

Eric Molitor emolitor at molitor.org
Wed Oct 27 07:42:42 PDT 2021


I missed this change so creating a second patch to apply after the HTTP 1.1
patch is applied.

- Eric

On Wed, Oct 27, 2021 at 1:58 PM Eric Molitor <emolitor at molitor.org> wrote:

> Agree, that could have been better. The attached patch adds HTTP 1.1 and
> chunked encoding support. It also cleans up and improves the header
> processing and adds comments to explain the logic. This also fixes a bug in
> the original implementations header processing where it was assumed that
> the first read would contain the complete headers.
>
> - Eric
>
> On Wed, Oct 27, 2021 at 4:30 AM Rob Landley <rob at landley.net> wrote:
>
>> On 10/26/21 9:05 AM, Eric Molitor wrote:
>> > Attached is an initial cleanup of wget. This addresses a number of
>> defects with
>> > the existing implementation and generally cleans up the code. I've
>> squashed the
>> > commits but can provide a more incremental set of patches if desired. I
>> have two
>> > more pending changes which correctly add HTTP 1.1 support, including
>> support for
>> > chunked encoding, as well as adding TLS support. However this was
>> already a huge
>> > change so working on landing this first before submitting the others
>> changes.
>>
>> Applied, but I'm not sure this moves it _closer_ to getting out of
>> pending:
>>
>> +#define WGET_FILENAME "Content-Disposition: attachment; filename="
>> ...
>> +  f = wget_strncaseafter(toybuf, WGET_FILENAME, body - toybuf);
>>
>> What does splitting a string a hundred lines away from its only user
>> accomplish?
>>
>> Rob
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20211027/76c958e2/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-wget-Fix-bug-if-read-fails.patch
Type: application/octet-stream
Size: 1195 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20211027/76c958e2/attachment-0003.obj>


More information about the Toybox mailing list