iPXE - Open Source Boot Firmware

[uri] Decode/encode URIs when parsing/unparsing
authorJoshua Oreman <oremanj@rwcr.net>
Wed, 30 Dec 2009 03:36:04 +0000 (22:36 -0500)
committerMarty Connor <mdc@etherboot.org>
Wed, 20 Jan 2010 23:14:28 +0000 (18:14 -0500)
commit3d9dd93a1452e28c728483b03e352691238491ed
tree73a41396fd514d12dbd7bd69ebfc49810bf73c7c
parentef9d1a32c6dc83d1086141c18d2be19a05ab8e49
[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>
src/core/settings.c
src/core/uri.c
src/include/gpxe/uri.h
src/net/tcp/http.c
src/tests/uri_test.c
src/usr/autoboot.c
src/usr/imgmgmt.c