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
Enable decoding URIs with ipv6 address in host. #6900
Conversation
CT Test Results 3 files 133 suites 47m 10s ⏱️ Results for commit eb4ef9d. ♻️ This comment has been updated with latest results. To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass. See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally. Artifacts// Erlang/OTP Github Action Bot |
Thanks for the feedback, I'll take a look this week hopefully and see if I can address your comments. |
@sverker I pushed another commit, this should cover the cases. Now it checks for both |
645a70c
to
3facfd6
Compare
Sorry, a missing
You will get here with
Add the "missing ]" into the test case. |
You're absolutely correct. I have forgotten the intricacies of C after so many years of not using it. We can choose between running |
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.
Could you write something in the documentation of erlang:decode_packet
about how the Host
string can be an ipv6 address within []
from OTP 26.0.
Yes, I can do that. |
eaa3661
to
f8d2a05
Compare
I added that requested documentation @sverker, hope it's sufficient. I also added a link to the RFC there. |
erts/emulator/beam/packet_parser.c
Outdated
uri->s1_len = n; | ||
n = uri_len - (n+1); | ||
// parse port if the next char is `:` | ||
if (memrchr(uri_ptr, ':', uri_len) == v + 1) { |
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.
memrchr
is a GNU extension not available on Windows:
packet_parser.o : error LNK2019: unresolved external symbol memrchr referenced in function http_parse_absoluteURI
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 will fix this
Example: Packet = <<"GET http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:4000/dir ...>> erlang:decode_packet(http_bin, Packet, [])
for completeness/symmetry with sys_memrchr().
eb4ef9d
to
ef1ded8
Compare
Fixes #6898