]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[uri] Refactor URI parsing and formatting
authorMichael Brown <mcb30@ipxe.org>
Thu, 27 Feb 2014 13:32:53 +0000 (13:32 +0000)
committerMichael Brown <mcb30@ipxe.org>
Thu, 27 Feb 2014 13:32:53 +0000 (13:32 +0000)
commit76675365271291beb9ddaeec10da14f4faa55ecc
tree0143200258d478e381b9d492bead2bdda91fe865
parentc7b69ac793b7704c09560eb6850e4ec2bd66e575
[uri] Refactor URI parsing and formatting

Add support for parsing of URIs containing literal IPv6 addresses
(e.g. "http://[fe80::69ff:fe50:5845%25net0]/boot.ipxe").

Duplicate URIs by directly copying the relevant fields, rather than by
formatting and reparsing a URI string.  This relaxes the requirements
on the URI formatting code and allows it to focus on generating
human-readable URIs (e.g. by not escaping ':' characters within
literal IPv6 addresses).  As a side-effect, this allows relative URIs
containing parameter lists (e.g. "../boot.php##params") to function
as expected.

Add validity check for FTP paths to ensure that only printable
characters are accepted (since FTP is a human-readable line-based
protocol with no support for character escaping).

Construct TFTP next-server+filename URIs directly, rather than parsing
a constructed "tftp://..." string,

Add self-tests for URI functions.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
12 files changed:
src/arch/i386/image/multiboot.c
src/core/uri.c
src/crypto/ocsp.c
src/include/ipxe/uri.h
src/net/tcp/ftp.c
src/net/tcp/httpcore.c
src/net/udp/slam.c
src/net/udp/tftp.c
src/tests/tests.c
src/tests/uri_test.c
src/usr/autoboot.c
src/usr/imgmgmt.c