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.
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
NameResolutionPal.Unix enabled async name resolution #34633
NameResolutionPal.Unix enabled async name resolution #34633
Changes from all commits
fc09ca1
8c955bc
cf13c70
4614267
1b2daab
b9629e9
6f64c86
e7df0cc
d7cb2be
74b3031
775ff72
ec8522f
298cf03
458579b
8f69164
8cec5fb
f3ebd6a
cf45cc9
43f889f
bd16c74
ed5c39f
b8efde5
04dbd8e
37e4dd3
7176378
b64867b
900834e
198717e
f85c316
438c75a
89c266f
33da8da
fa9c6f9
8266dd3
75e52c7
89a7c5a
dd1e245
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Why is the fence necessary?
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.
This callback comes in on another thread. It ensures visibility to this thread of everything in
state
.getaddrinfo_a
probably does something like this already, so it might be safe to remove, but it isn't documented.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.
_POSIX_HOST_NAME_MAX
is fixed to 255. It's more than the 253 according the RFC (cf. #34633 (comment)), but it matchesruntime/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetHostName.cs
Line 18 in 458579b
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.
BTW: neither the Windows-Pal nor the sync-version have a check for max hostname. Should these be added (at the managed side to catch them early)? Or leave it as the uncommon case and let the OS handle it?
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 this case, it's better to check because you're computing the allocation length based on what is potentially user input; that could overflow and become an issue. By capping it to
POSIX_HOST_NAME_MAX
like you did here, the overflow is avoided (and there's no need to perform an overflow check).In other cases, it's fine to leave it to the OS to verify, as they're passing the string as it is to the system calls/library functions.