mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-28 01:01:34 +00:00
feat: don't report inbound stream upgrade errors to handler
When an inbound stream upgrade fails, there isn't a whole lot we can do about that in the handler. In fact, for several errors, we wouldn't even know which specific handler to target, for example, `NegotiationFailed`. Similiarly, in case of an IO error during the upgrade, we don't know which handler the stream was eventually meant to be for. Pull-Request: #3605.
This commit is contained in:
@ -273,12 +273,26 @@ where
|
||||
));
|
||||
continue;
|
||||
}
|
||||
Poll::Ready(Some((info, Err(error)))) => {
|
||||
Poll::Ready(Some((
|
||||
info,
|
||||
Err(ConnectionHandlerUpgrErr::Upgrade(UpgradeError::Apply(error))),
|
||||
))) => {
|
||||
handler.on_connection_event(ConnectionEvent::ListenUpgradeError(
|
||||
ListenUpgradeError { info, error },
|
||||
));
|
||||
continue;
|
||||
}
|
||||
Poll::Ready(Some((
|
||||
_,
|
||||
Err(ConnectionHandlerUpgrErr::Upgrade(UpgradeError::Select(e))),
|
||||
))) => {
|
||||
log::debug!("failed to upgrade inbound stream: {e}");
|
||||
continue;
|
||||
}
|
||||
Poll::Ready(Some((_, Err(ConnectionHandlerUpgrErr::Timeout)))) => {
|
||||
log::debug!("inbound stream upgrade timed out");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Ask the handler whether it wants the connection (and the handler itself)
|
||||
|
Reference in New Issue
Block a user