Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.2k
url,src: simplify ipv6 logic by using uv_inet_pton#38842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
src/node_url.cc Outdated
| std::string domain_or_opaque; | ||
| uint32_t ipv4; | ||
| uint16_t ipv6[8]; | ||
| uint16_t ipv6[NS_IN6ADDRSZ / NS_INT16SZ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think just 8 was a bit clearer here, to be honest…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don’t think glibc is the gold standard for code readability here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed it back.🐣
| memset(buf, 0, sizeof(buf)); | ||
| memcpy(*ipv6, input, sizeof(constchar) * length); | ||
| int ret = uv_inet_pton(AF_INET6, *ipv6, buf); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In theory I'm +1 but we need to make sure that uv_inet_pton matches what the url standard expects here. The reason for the more complicated implementation is that it's what the standard spec specifically calls out.
XadillaXMay 31, 2021 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- It passes wpt;
uv_inet_ntopandinet_ntopbreaksURLHost::ToString()because it does not match web standard...:x.x.x.x. So I do not modify logic by using*_ntop.
nodejs-github-bot commented Jun 2, 2021
PR-URL: #38842 Reviewed-By: Anna Henningsen <[email protected]>
XadillaX commented Jun 10, 2021
Landed in c109a6c |
PR-URL: #38842 Reviewed-By: Anna Henningsen <[email protected]>
PR-URL: #38842 Reviewed-By: Anna Henningsen <[email protected]>
PR-URL: #38842 Reviewed-By: Anna Henningsen <[email protected]>
PR-URL: #38842 Reviewed-By: Anna Henningsen <[email protected]>
PR-URL: nodejs#38842 Reviewed-By: Anna Henningsen <[email protected]>
No description provided.