Use the same TcpSocket in WASIp{2,3}#11386
Conversation
This is the same as bytecodealliance#11384 except for `TcpSocket` to share the implementation of TCP across WASIp{2,3} and avoid duplicating code between the two.
rvolosatovs
left a comment
There was a problem hiding this comment.
It's a bit hard to keep track of all the changes, but I checked out the code locally to do a little overview and changes look good to me.
Is changing the wasip2 socket behavior a concern at all? (e.g. TcpSocket::new now returning "access denied")
Like UDP only perform the check on socket creation, not after it's created.
|
It's an intentional change yeah as I think it makes more sense to gate creation of sockets rather than gate operations on the sockets since it consolidates the check into just one place instead of having it spread out. It's also non-standard behavior in the sense that it's not specified in WASI itself, so it should be ok to tweak it's behavior over time. While the error is shuffled around disabling TCP and/or UDP still has the same effect where you can't do anything TCP/UDP-related once the options are disabled. |
* Use the same `TcpSocket` in WASIp{2,3}
This is the same as bytecodealliance#11384 except for `TcpSocket` to share the
implementation of TCP across WASIp{2,3} and avoid duplicating code
between the two.
* Fix CI issues
* Review comments
* Trim "TCP allowed?" checks
Like UDP only perform the check on socket creation, not after it's
created.
This is the same as #11384 except for
TcpSocketto share the implementation of TCP across WASIp{2,3} and avoid duplicating code between the two.