ConnMan network manager
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Grant Erickson <gerickson@nuovations.com>
Cc: connman@lists.linux.dev, Denis Kenzior <denkenz@gmail.com>
Subject: Re: [PATCH v6 0/3] gweb: refactor parse_url for IPv6 addresses.
Date: Sat, 11 Nov 2023 19:16:40 +0100	[thread overview]
Message-ID: <2717EB84-A614-4954-85D8-48F391769EF4@holtmann.org> (raw)
In-Reply-To: <D7CD4553-EAFB-4A13-8847-668F8E909424@nuovations.com>

Hi Grant,

> Prior to this change, 'parse_url' failed to correctly handle RFC 2732-
> compliant URLs with bracketed IPv6 addresses such as:
> 
>    http://[2001:db8:4006:812::200e]:8080/online/status.html
> 
> Such bracketing is necessary when using IPv6 addresses to disambiguate
> the host component from the port component due to the presence of the
> colon (':') in IPv6 addresses. As such, prior to this change, such URLs
> resulted in the brackets and the IPv6 address being passed to GResolv
> which, unsurprisingly, failed to successfully forward resolve since the
> resulting host was neither a valid host name nor a valid IPv6 address.
> 
> As a result, support for such RFC 2732-compliant bracketed IPv6
> addresses has been added with this change which refactors the
> previously-monolithic 'parse_url' into several, focused functions:
> 
>    * parse_request_and_proxy_urls
>        - parse_request_url
>            o parse_url_components
>                + parse_url_scheme
>                + parse_url_host_and_port
>                    * parse_url_host
>                    * parse_url_port
>                + parse_url_path
>        - parse_proxy_url
> 
> In particular, 'parse_url_host' is the new function responsible for
> parsing the host and correctly handling one of seven possible
> combinations of host and port, two of which include bracketed IPv6
> addresses.
> 
> In addition, 'parse_url_host' will now return an error on an empty,
> non-existent host and 'parse_url_port' will return an error on invalid,
> out-of-range ports.
> 
> Grant Erickson (3):
>  gweb: Rename 'parse_url'.
>  gweb: Refactor 'parse_request_and_proxy_urls'.
>  gweb: Add documentation to URL parsing functions.
> 
> gweb/gweb.c | 855 ++++++++++++++++++++++++++++++++++++++++++++++++----
> 1 file changed, 789 insertions(+), 66 deletions(-)

all 3 patches have been applied.

Regards

Marcel


      parent reply	other threads:[~2023-11-11 18:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-11 17:44 [PATCH v6 0/3] gweb: refactor parse_url for IPv6 addresses Grant Erickson
2023-11-11 17:45 ` [PATCH v6 1/3] gweb: Rename 'parse_url' Grant Erickson
2023-11-11 17:47 ` [PATCH v6 2/3] gweb: Refactor 'parse_request_and_proxy_urls' Grant Erickson
2023-11-11 17:47 ` [PATCH v6 3/3] gweb: Add documentation to URL parsing functions Grant Erickson
2023-11-11 18:16 ` Marcel Holtmann [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2717EB84-A614-4954-85D8-48F391769EF4@holtmann.org \
    --to=marcel@holtmann.org \
    --cc=connman@lists.linux.dev \
    --cc=denkenz@gmail.com \
    --cc=gerickson@nuovations.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).