diff --git a/README.rst b/README.rst index b2ca337..4e8c470 100644 --- a/README.rst +++ b/README.rst @@ -11,6 +11,11 @@ There is a slight difference in a return code when they fail. `urlparse_parse_url()` returns the negative error code ``URLPARSE_ERR_PARSE`` if it fails. +A caller needs to call `http_parser_url_init()` before +`http_parser_parse_url()`. urlparse does not need a similar function +because `urlparse_parser_url()` initializes ``urlparse_url`` before +its use. + `url_parser_parse_url()` historically does not follow any standards like RFC 3986. Here is the allowed characters in each URL component: diff --git a/urlparse.h b/urlparse.h index e39ba71..8941ba2 100644 --- a/urlparse.h +++ b/urlparse.h @@ -154,6 +154,9 @@ typedef struct urlparse_url { * the URL as a request target that appears in CONNECT request, that * is, consisting of only the host and port number. * + * This function initializes |u| before its use. If this function + * returns nonzero, |u| might not be initialized. + * * This function returns 0 if it succeeds, or * :macro:`URLPARSE_ERR_PARSE`. */