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

Eric Molitor emolitor at molitor.org
Wed Oct 27 05:58:39 PDT 2021


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/3fc71b68/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-wget-Cleanup-and-add-support-for-HTTP-1.1-and-chunke.patch
Type: application/octet-stream
Size: 11108 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20211027/3fc71b68/attachment-0003.obj>


More information about the Toybox mailing list