fix(webrtc): gracefully handle resets of individual connections

Fixes https://github.com/libp2p/rust-libp2p/issues/3574

Pull-Request: #3575.
This commit is contained in:
Doug A 2023-03-10 13:40:59 -04:00 committed by GitHub
parent dea6a8c4a9
commit 83ef657500
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -1,7 +1,11 @@
# 0.4.0-alpha.3 - unreleased
- Gracefully handle `ConnectionReset` error on individual connections, avoiding shutdown of the entire listener upon disconnect of a single client.
See [PR 3575].
- Migrate from `prost` to `quick-protobuf`. This removes `protoc` dependency. See [PR 3312].
[PR 3575]: https://github.com/libp2p/rust-libp2p/pull/3575
[PR 3312]: https://github.com/libp2p/rust-libp2p/pull/3312
# 0.4.0-alpha.2

View File

@ -398,8 +398,11 @@ impl UDPMuxNewAddr {
continue;
}
Poll::Ready(Err(err)) if err.kind() == ErrorKind::TimedOut => {}
Poll::Pending => {}
Poll::Ready(Err(err)) if err.kind() == ErrorKind::TimedOut => {}
Poll::Ready(Err(err)) if err.kind() == ErrorKind::ConnectionReset => {
log::debug!("ConnectionReset by remote client {err:?}")
}
Poll::Ready(Err(err)) => {
log::error!("Could not read udp packet: {}", err);
return Poll::Ready(UDPMuxEvent::Error(err));