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

Resolve stopped/received_reset futures on lost connections #1886

Merged
merged 1 commit into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions quinn/src/recv_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,9 @@ impl RecvStream {
Poll::Ready(Ok(Some(error_code)))
}
Ok(None) => {
if let Some(e) = &conn.error {
return Poll::Ready(Err(e.clone().into()));
}
// Resets always notify readers, since a reset is an immediate read error. We
// could introduce a dedicated channel to reduce the risk of spurious wakeups,
// but that increased complexity is probably not justified, as an application
Expand Down
3 changes: 3 additions & 0 deletions quinn/src/send_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ impl SendStream {
Err(_) => Poll::Ready(Ok(None)),
Ok(Some(error_code)) => Poll::Ready(Ok(Some(error_code))),
Ok(None) => {
if let Some(e) = &conn.error {
return Poll::Ready(Err(e.clone().into()));
}
conn.stopped.insert(self.stream, cx.waker().clone());
Poll::Pending
}
Expand Down