X-Git-Url: https://pd.if.org/git/?p=zpackage;a=blobdiff_plain;f=crypto%2Frfc3986.re;h=ce7ce8a9c2b63e8ccd36c674fc37c811397d2d82;hp=feaf49ac0340942c92700db180b867c49ce4d61b;hb=6ff53c22d4ab08760c5e8747cd12e4f8bc0b82f6;hpb=d1ba8bc5b1082bf13ea3b3a7d8b7b688191c766d diff --git a/crypto/rfc3986.re b/crypto/rfc3986.re index feaf49a..ce7ce8a 100644 --- a/crypto/rfc3986.re +++ b/crypto/rfc3986.re @@ -20,7 +20,9 @@ struct tls_uri { char *host; char *port; char *path; + char *encoded_path; char *query; + char *encoded_query; char *fragment; }; @@ -202,6 +204,13 @@ int tls_parse_uri(char *s, struct tls_uri *uri) { } } + if (uri->path) { + uri->encoded_path = strdup(uri->path); + } + if (uri->query) { + uri->encoded_query = strdup(uri->query); + } + percent_decode(uri->host); percent_decode(uri->path); percent_decode(uri->query); @@ -230,5 +239,8 @@ void tls_free_uri(struct tls_uri *uri) { uri->scheme = 0; free(uri->fragment); uri->fragment = 0; - + free(uri->encoded_path); + uri->encoded_path = 0; + free(uri->encoded_query); + uri->encoded_query = 0; }