Skip to content

Commit

Permalink
Merge pull request #5 from ngtcp2/doc-url-init
Browse files Browse the repository at this point in the history
Describe urlparse_url initialization
  • Loading branch information
tatsuhiro-t authored Nov 15, 2024
2 parents aa4aeb7 + 0041185 commit 59b068a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
3 changes: 3 additions & 0 deletions urlparse.h
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
*/
Expand Down

0 comments on commit 59b068a

Please sign in to comment.