Skip to content

Commit 7667536

Browse files
committedFeb 27, 2014
[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>
1 parent c7b69ac commit 7667536

File tree

12 files changed

+1312
-437
lines changed

12 files changed

+1312
-437
lines changed
 

‎src/arch/i386/image/multiboot.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,7 @@ static physaddr_t multiboot_add_cmdline ( struct image *image ) {
152152
size_t len;
153153

154154
/* Copy image URI to base memory buffer as start of command line */
155-
len = ( unparse_uri ( buf, remaining, image->uri,
156-
URI_ALL ) + 1 /* NUL */ );
155+
len = ( format_uri ( image->uri, buf, remaining ) + 1 /* NUL */ );
157156
if ( len > remaining )
158157
len = remaining;
159158
mb_cmdline_offset += len;

0 commit comments

Comments
 (0)
Please sign in to comment.