Any optional elements portions not present in the original URI are
left set to NULL in the resulting evhttp_uri. If no port is
specified, the port is set to -1.
Note that no decoding is performed on percent-escaped characters in
the string; if you want to parse them, use evhttp_uridecode or
evhttp_parse_query_str as appropriate.
Note also that most URI schemes will have additional constraints that
this function does not know about, and cannot check. For example,
mailto://www.example.com/cgi-bin/fortune.pl is not a reasonable
mailto url, http://www.example.com:99999/ is not a reasonable HTTP
URL, and ftp:username@example.com is not a reasonable FTP URL.
Nevertheless, all of these URLs conform to RFC3986, and this function
accepts all of them as valid.
@param source_uri the request URI
@param flags Zero or more EVHTTP_URI_* flags to affect the behavior
of the parser.
@return uri container to hold parsed data, or NULL if there is error
@see evhttp_uri_free()
Helper function to parse a URI-Reference as specified by RFC3986.
This function matches the URI-Reference production from RFC3986, which includes both URIs like
scheme://[userinfo@]foo.com[:port]]/path[?query]fragment
and relative-refs like
path[?query]fragment
Any optional elements portions not present in the original URI are left set to NULL in the resulting evhttp_uri. If no port is specified, the port is set to -1.
Note that no decoding is performed on percent-escaped characters in the string; if you want to parse them, use evhttp_uridecode or evhttp_parse_query_str as appropriate.
Note also that most URI schemes will have additional constraints that this function does not know about, and cannot check. For example, mailto://www.example.com/cgi-bin/fortune.pl is not a reasonable mailto url, http://www.example.com:99999/ is not a reasonable HTTP URL, and ftp:username@example.com is not a reasonable FTP URL. Nevertheless, all of these URLs conform to RFC3986, and this function accepts all of them as valid.
@param source_uri the request URI @param flags Zero or more EVHTTP_URI_* flags to affect the behavior of the parser. @return uri container to hold parsed data, or NULL if there is error @see evhttp_uri_free()