mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-07-24 13:41:56 +00:00
Make errors on listener non-fatal (#1427)
* Make errors on listener non-fatal * Fix bad rename * Some changes to trait bounds * Fix noise tests * Apply suggestions from code review Co-Authored-By: Toralf Wittner <tw@dtex.org> * Add reason for closure * Fix intra-doc link Co-authored-by: Toralf Wittner <tw@dtex.org>
This commit is contained in:
@@ -109,7 +109,7 @@ where
|
||||
{
|
||||
type Output = Connection<T::Output>;
|
||||
type Error = Error<T::Error>;
|
||||
type Listener = BoxStream<'static, Result<ListenerEvent<Self::ListenerUpgrade>, Self::Error>>;
|
||||
type Listener = BoxStream<'static, Result<ListenerEvent<Self::ListenerUpgrade, Self::Error>, Self::Error>>;
|
||||
type ListenerUpgrade = BoxFuture<'static, Result<Self::Output, Self::Error>>;
|
||||
type Dial = BoxFuture<'static, Result<Self::Output, Self::Error>>;
|
||||
|
||||
@@ -147,6 +147,9 @@ where
|
||||
a = a.with(proto.clone());
|
||||
ListenerEvent::AddressExpired(a)
|
||||
}
|
||||
ListenerEvent::Error(err) => {
|
||||
ListenerEvent::Error(Error::Transport(err))
|
||||
}
|
||||
ListenerEvent::Upgrade { upgrade, mut local_addr, mut remote_addr } => {
|
||||
local_addr = local_addr.with(proto.clone());
|
||||
remote_addr = remote_addr.with(proto.clone());
|
||||
|
@@ -117,7 +117,7 @@ where
|
||||
}
|
||||
|
||||
/// Type alias corresponding to `framed::WsConfig::Listener`.
|
||||
pub type InnerStream<T, E> = BoxStream<'static, Result<ListenerEvent<InnerFuture<T, E>>, Error<E>>>;
|
||||
pub type InnerStream<T, E> = BoxStream<'static, Result<ListenerEvent<InnerFuture<T, E>, Error<E>>, Error<E>>>;
|
||||
|
||||
/// Type alias corresponding to `framed::WsConfig::Dial` and `framed::WsConfig::ListenerUpgrade`.
|
||||
pub type InnerFuture<T, E> = BoxFuture<'static, Result<Connection<T>, Error<E>>>;
|
||||
|
Reference in New Issue
Block a user