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:
Thomas Eizinger
2023-05-08 06:54:50 +02:00
committed by GitHub
parent 2130923aa5
commit 53e5370919
21 changed files with 90 additions and 553 deletions

View File

@ -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)