summaryrefslogtreecommitdiffstats
path: root/src/usr/imgmgmt.c
diff options
context:
space:
mode:
authorJoshua Oreman2009-12-30 04:36:04 +0100
committerMarty Connor2010-01-21 00:14:28 +0100
commit3d9dd93a1452e28c728483b03e352691238491ed (patch)
tree73a41396fd514d12dbd7bd69ebfc49810bf73c7c /src/usr/imgmgmt.c
parent[settings] Add automagic "netX" settings block for last opened netdev (diff)
downloadipxe-3d9dd93a1452e28c728483b03e352691238491ed.tar.gz
ipxe-3d9dd93a1452e28c728483b03e352691238491ed.tar.xz
ipxe-3d9dd93a1452e28c728483b03e352691238491ed.zip
[uri] Decode/encode URIs when parsing/unparsing
Currently, handling of URI escapes is ad-hoc; escaped strings are stored as-is in the URI structure, and it is up to the individual protocol to unescape as necessary. This is error-prone and expensive in terms of code size. Modify this behavior by unescaping in parse_uri() and escaping in unparse_uri() those fields that typically handle URI escapes (hostname, user, password, path, query, fragment), and allowing unparse_uri() to accept a subset of fields to print so it can be easily used to generate e.g. the escaped HTTP path?query request. Signed-off-by: Joshua Oreman <oremanj@rwcr.net> Signed-off-by: Marty Connor <mdc@etherboot.org>
Diffstat (limited to 'src/usr/imgmgmt.c')
-rw-r--r--src/usr/imgmgmt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/usr/imgmgmt.c b/src/usr/imgmgmt.c
index 0ffff5d4..023e3f0f 100644
--- a/src/usr/imgmgmt.c
+++ b/src/usr/imgmgmt.c
@@ -61,7 +61,7 @@ int imgfetch ( struct image *image, const char *uri_string,
if ( password )
uri->password = "***";
unparse_uri ( uri_string_redacted, sizeof ( uri_string_redacted ),
- uri );
+ uri, URI_ALL );
uri->password = password;
if ( ( rc = create_downloader ( &monojob, image, image_register,