Skip to content

Commit

Permalink
fix(quic): don't report error for gracefully closed connections
Browse files Browse the repository at this point in the history
Closes quinn's `Endpoint` with `Ok(())`  when `Accept` returns `None`.

Resolves: #4588.
Related: quinn-rs/quinn#1676.

Pull-Request: #4621.
  • Loading branch information
jxs committed Oct 12, 2023
1 parent 5c498f6 commit 497f393
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions transports/quic/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
## 0.9.3 - unreleased

- No longer report error when explicit closing of a QUIC endpoint succeeds.
See [PR 4621].

- Support QUIC stateless resets for supported `libp2p_identity::Keypair`s. See [PR 4554].

[PR 4621]: https://github.com/libp2p/rust-libp2p/pull/4621
[PR 4554]: https://github.com/libp2p/rust-libp2p/pull/4554

## 0.9.2
Expand Down
1 change: 1 addition & 0 deletions transports/quic/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ pub enum Error {
Io(#[from] std::io::Error),

/// The task to drive a quic endpoint has crashed.
#[deprecated(since = "0.9.3", note = "No longer emitted")]
#[error("Endpoint driver crashed")]
EndpointDriverCrashed,

Expand Down
2 changes: 1 addition & 1 deletion transports/quic/src/transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ impl<P: Provider> Stream for Listener<P> {
return Poll::Ready(Some(event));
}
Poll::Ready(None) => {
self.close(Err(Error::EndpointDriverCrashed));
self.close(Ok(()));
continue;
}
Poll::Pending => {}
Expand Down

0 comments on commit 497f393

Please sign in to comment.