diff options
author | Michael Brown <mcb30@ipxe.org> | 2015-08-25 12:33:40 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2015-08-25 13:31:46 +0100 |
commit | ba3695353add020b686547699ba5e259c339bfa6 (patch) | |
tree | d400084f87152adbbbc7dbca3140c1c2789c03b0 /src/include/ipxe/uri.h | |
parent | 4e03af8ec2d497e725566a91fd5c19dd604c18a6 (diff) | |
download | ipxe-ba3695353add020b686547699ba5e259c339bfa6.tar.gz |
[settings] Re-add "uristring" setting type
Commit 09b057c ("[settings] Remove "uristring" setting type") removed
support for URI-encoded settings via the "uristring" setting type, on
the basis that such encoding was no longer necessary to avoid problems
with the command line parser.
Other valid use cases for the "uristring" setting type do exist: for
example, a password containing a '/' character expanded via
chain http://username:${password:uristring}@server.name/boot.php
Restore the existence of the "uristring" setting, avoiding the
potentially large stack allocations that were used in the old code
prior to commit 09b057c ("[settings] Remove "uristring" setting
type").
Requested-by: Robin Smidsrød <robin@smidsrod.no>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/uri.h')
-rw-r--r-- | src/include/ipxe/uri.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/include/ipxe/uri.h b/src/include/ipxe/uri.h index 00e5a24c4..ce6a684c9 100644 --- a/src/include/ipxe/uri.h +++ b/src/include/ipxe/uri.h @@ -191,8 +191,11 @@ uri_put ( struct uri *uri ) { extern struct uri *cwuri; -extern size_t uri_encode ( const char *string, unsigned int field, +extern size_t uri_decode ( const char *encoded, void *buf, size_t len ); +extern size_t uri_encode ( unsigned int field, const void *raw, size_t raw_len, char *buf, ssize_t len ); +extern size_t uri_encode_string ( unsigned int field, const char *string, + char *buf, ssize_t len ); extern struct uri * parse_uri ( const char *uri_string ); extern size_t format_uri ( const struct uri *uri, char *buf, size_t len ); extern char * format_uri_alloc ( const struct uri *uri ); |