Skip to content
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

Added a fix so that try_read calls close the connection without returning errors and causing a panic #4633

Merged
merged 1 commit into from
May 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Added a fix so that try_read calls close the connection without retur…
…ning errors and causing a panic
  • Loading branch information
john-sharratt committed Apr 30, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit eda79e2556024f15e86fec19e335fb27a0b6d3c0
5 changes: 4 additions & 1 deletion lib/virtual-net/src/tcp_pair.rs
Original file line number Diff line number Diff line change
@@ -250,7 +250,10 @@ impl SocketBuffer {
}
State::Dead => {
tracing::trace!("try_read: socket is dead");
return Err(NetworkError::ConnectionReset);
// Note: Returning `ConnectionReset` here may seem logical as other functions return this
// however this code path is not always handled properly. In particular `tokio` inside
// WASIX will panic if it receives this code.
return Ok(0);
}
State::Closed | State::Shutdown => {
tracing::trace!("try_read: socket is closed or shutdown");
Loading