| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
The struct must be zero-initialized, but this wasn't explicitly stated anywhere in headers. Introduce `http_parser_url_init` API method that will do it. Fix nodejs#209
|
My pr at #222 is more comprehensive, I'm not sure why you closed it as unnecessary. I added the parameter checking and zeroed the structure. In http_parse_host there's no point continuing without the host field and in http_parser_parse_url there's no point calling the former without the host field. Also something should be done to make sure that the buflen isn't greater than max uint16_t, which I covered in both. Also it occurs to me now an overflow check is also due for size_t buflen assignment in http_parse_host since there's no guarantee size_t is greater than uint16_t (although it's extremely likely), which would probably look something like this, placed immediately after the assignment: if(buflen < u->field_data[UF_HOST].off) { // overflow
return 1;
} |
Sorry, something went wrong.
|
It won't call it without host field, because UF_HOST won't be set. In case of test string it is doing a right thing and treating test as a schema, and then awaits for the hostname. |
Sorry, something went wrong.
|
In the case a schema field was found but a host field was not then http_parser_parse_url will still call http_parse_host. I changed that by failing if a schema field is found without a host field and calling http_parse_host only if a host field was found as seen here. |
Sorry, something went wrong.
|
Right and http_parse_host is called because it is what is expected after the scheme. It is intentionally invoked for this thing to fail. Practically, is there any difference in behavior your PR and current implementation (in master branch)? |
Sorry, something went wrong.
|
Yes it's different. The current implementation is calling http_parse_host when UF_HOST is not set which contradicts what you said earlier. Whether that's correct or not you would know having more familiarity with the code base, however I did not think that was correct. |
Sorry, something went wrong.
|
Right, I was wrong about it. Sorry. However, except this I don't see any behavior difference. |
Sorry, something went wrong.
|
@mscdex may I ask you to review it? ;) |
Sorry, something went wrong.
Sorry, something went wrong.
|
LGTM |
Sorry, something went wrong.
significant updates: * [[`777ba4eded`](nodejs@777ba4eded)] - **src**: introduce `http_parser_url_init` (Fedor Indutny) [nodejs/http-parser#225](nodejs/http-parser#225) * [[`e557b62744`](nodejs@e557b62744)] - **src**: support LINK/UNLINK (RFC 2068, draft-snell-link-method) (Olivier Mengué) [nodejs/http-parser#267](nodejs/http-parser#267) * [[`eb5e9928b4`](nodejs@eb5e9928b4)] - **src**: support ACL (WebDAV, RFC3744, Section 8.1). (Ivan Enderlin) [nodejs/http-parser#260](nodejs/http-parser#260) * [[`8b1d652322`](nodejs@8b1d652322)] - **src**: support BIND/REBIND/UNBIND (WebDAV, RFC5842) (Ivan Enderlin) [nodejs/http-parser#242](nodejs/http-parser#242) * [[`7d75dd7325`](nodejs@7d75dd7325)] - **src**: support IPv6 Zone ID as per RFC 6874 (Tatsuhiro Tsujikawa) [nodejs/http-parser#253](nodejs/http-parser#253)
significant updates: * [[`777ba4eded`](777ba4eded)] - **src**: introduce `http_parser_url_init` (Fedor Indutny) [nodejs/http-parser#225](nodejs/http-parser#225) * [[`e557b62744`](e557b62744)] - **src**: support LINK/UNLINK (RFC 2068, draft-snell-link-method) (Olivier Mengué) [nodejs/http-parser#267](nodejs/http-parser#267) * [[`eb5e9928b4`](eb5e9928b4)] - **src**: support ACL (WebDAV, RFC3744, Section 8.1). (Ivan Enderlin) [nodejs/http-parser#260](nodejs/http-parser#260) * [[`8b1d652322`](8b1d652322)] - **src**: support BIND/REBIND/UNBIND (WebDAV, RFC5842) (Ivan Enderlin) [nodejs/http-parser#242](nodejs/http-parser#242) * [[`7d75dd7325`](7d75dd7325)] - **src**: support IPv6 Zone ID as per RFC 6874 (Tatsuhiro Tsujikawa) [nodejs/http-parser#253](nodejs/http-parser#253) PR-URL: #3569 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
significant updates: * [[`777ba4eded`](777ba4eded)] - **src**: introduce `http_parser_url_init` (Fedor Indutny) [nodejs/http-parser#225](nodejs/http-parser#225) * [[`e557b62744`](e557b62744)] - **src**: support LINK/UNLINK (RFC 2068, draft-snell-link-method) (Olivier Mengué) [nodejs/http-parser#267](nodejs/http-parser#267) * [[`eb5e9928b4`](eb5e9928b4)] - **src**: support ACL (WebDAV, RFC3744, Section 8.1). (Ivan Enderlin) [nodejs/http-parser#260](nodejs/http-parser#260) * [[`8b1d652322`](8b1d652322)] - **src**: support BIND/REBIND/UNBIND (WebDAV, RFC5842) (Ivan Enderlin) [nodejs/http-parser#242](nodejs/http-parser#242) * [[`7d75dd7325`](7d75dd7325)] - **src**: support IPv6 Zone ID as per RFC 6874 (Tatsuhiro Tsujikawa) [nodejs/http-parser#253](nodejs/http-parser#253) PR-URL: #3569 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
| Back | FazBrowse Home | New Git URL |
The struct must be zero-initialized, but this wasn't explicitly stated
anywhere in headers. Introduce http_parser_url_init API method that
will do it.
Fix #209
cc @bnoordhuis