From 76675365271291beb9ddaeec10da14f4faa55ecc Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Thu, 27 Feb 2014 13:32:53 +0000 Subject: [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 --- src/arch/i386/image/multiboot.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/arch') diff --git a/src/arch/i386/image/multiboot.c b/src/arch/i386/image/multiboot.c index 3d6d2bf34..86b0bc12d 100644 --- a/src/arch/i386/image/multiboot.c +++ b/src/arch/i386/image/multiboot.c @@ -152,8 +152,7 @@ static physaddr_t multiboot_add_cmdline ( struct image *image ) { size_t len; /* Copy image URI to base memory buffer as start of command line */ - len = ( unparse_uri ( buf, remaining, image->uri, - URI_ALL ) + 1 /* NUL */ ); + len = ( format_uri ( image->uri, buf, remaining ) + 1 /* NUL */ ); if ( len > remaining ) len = remaining; mb_cmdline_offset += len; -- cgit v1.2.3-55-g7522