Uh oh!
There was an error while loading. Please reload this page.
ARROW-10475: [C++][FlightRPC] handle IPv6 hosts - #8585
Closed
lidavidm wants to merge 1 commit into
Closed
Conversation
lidavidmforce-pushed
the
arrow-10475
branch
2 times, most recently
from
November 4, 2020 13:24
e865b40 to
0ee5af7Comparepitrou
commented
Nov 9, 2020
Member
Those tests are correct, but we can add a function to encode back the host ( |
MemberAuthor
I've added a method on the Uri class now to format the host, though the implementation is essentially the naive one still (if ipv6 add brackets else pass through the host). |
pitrou
commented
Nov 12, 2020
Member
I meant a separate function, not a method. The host doesn't necessarily come from a URI. |
lidavidm
commented
Nov 13, 2020
MemberAuthor
Ah sorry, I think I got what you mean now - updated. |
pitrou
approved these changes
Nov 16, 2020
This was referenced Oct 15, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
uriparser has a more detailed hostData struct that exposes whether the host is IPv4, IPv6, or something else, but doesn't provide apparent ways to convert back. There's also already tests for the current behavior (IPv6 host gets returned without brackets). If we don't care about those tests, we can simply check if uriparser thinks the host is IPv6, and if so, add the brackets back, without writing an IPv6/IPv4 address formatter. (Though that's technically wrong, I suppose - the host is really the unbracketed address, and the brackets only come into play when formatted as a URI.)
Otherwise, here I check if the host looks like IPv6 inside Flight and add the brackets back.