-
Notifications
You must be signed in to change notification settings - Fork 1.7k
wasi implementations: use rc-2024-01-16 for sockets, cli, http #7781
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
79013c1
wasi: pull in contents of wasi-sockets, wasi-http, and wasi-cli 0.2.0…
pchickey 872406b
command-extended and test worlds: use rc-2024-01-16
pchickey 9124e03
sockets implementation: v6only is now mandatory
pchickey b7d228f
adapter: cli imports and exports are from rc-2024-01-16 now
pchickey 5cef294
eliminate ipv6-only methods and tests
pchickey 6bc8d92
component-basic: update wasi:cli version
pchickey 89a38b0
wasi-http: sync wit directory
pchickey 76f33c2
wasi-http: fix import version
pchickey b20bc2c
code review from dave
pchickey f085683
test both ipv4 address on v6 socket, and ipv6-mapped-ipv4 on v6 socke…
pchickey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -88,38 +88,21 @@ fn test_udp_connect_dual_stack(net: &Network) { | |
| IpSocketAddress::new(IpAddress::IPV4_MAPPED_LOOPBACK, v4_server_addr.port()); | ||
|
|
||
| // Tests: | ||
| { | ||
| let v6_client = UdpSocket::new(IpAddressFamily::Ipv6).unwrap(); | ||
|
|
||
| // Even on platforms that don't support dualstack sockets, | ||
| // setting ipv6_only to true (disabling dualstack mode) should work. | ||
| v6_client.set_ipv6_only(true).unwrap(); | ||
|
|
||
| v6_client.blocking_bind_unspecified(&net).unwrap(); | ||
|
|
||
| // Connecting to an IPv4-mapped-IPv6 address on an ipv6-only socket should fail: | ||
| assert!(matches!( | ||
| v6_client.stream(Some(v6_server_addr)), | ||
| Err(ErrorCode::InvalidArgument) | ||
| )); | ||
| } | ||
|
|
||
| { | ||
| let v6_client = UdpSocket::new(IpAddressFamily::Ipv6).unwrap(); | ||
|
|
||
| v6_client.set_ipv6_only(false).unwrap(); | ||
| v6_client.blocking_bind_unspecified(&net).unwrap(); | ||
| v6_client.stream(Some(v6_server_addr)).unwrap(); | ||
|
|
||
| assert_eq!( | ||
| v6_client.local_address().unwrap().family(), | ||
| IpAddressFamily::Ipv6 | ||
| ); | ||
| assert_eq!( | ||
| v6_client.remote_address().unwrap().family(), | ||
| IpAddressFamily::Ipv6 | ||
| ); | ||
| } | ||
| let v6_client = UdpSocket::new(IpAddressFamily::Ipv6).unwrap(); | ||
|
|
||
| v6_client.blocking_bind_unspecified(&net).unwrap(); | ||
|
|
||
| // Connecting to an IPv4 address on an IPv6 socket should fail: | ||
| assert!(matches!( | ||
| v6_client.stream(Some(v4_server_addr)), | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See previous comment |
||
| Err(ErrorCode::InvalidArgument) | ||
| )); | ||
|
|
||
| // Connecting to an IPv4-mapped-IPv6 address on an IPv6 socket should fail: | ||
| assert!(matches!( | ||
| v6_client.stream(Some(v6_server_addr)), | ||
| Err(ErrorCode::InvalidArgument) | ||
| )); | ||
| } | ||
|
|
||
| fn main() { | ||
|
|
||
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
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
Oops, something went wrong.
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.
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 should attempt to connect to
v6_listener_addrwhich was a IPv4-mapped-IPv6 address. The way you rewrote it, this call doesn't actually test the change.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.
Got it - thanks!