Remove ProtocolsHandlerUpgrErr::MuxerDeniedSubstream. (#1043)

Closes #1042.
This commit is contained in:
Toralf Wittner
2019-04-04 19:11:59 +02:00
committed by GitHub
parent 1d4324ab70
commit fac1ba12ec
2 changed files with 0 additions and 12 deletions

View File

@ -295,8 +295,6 @@ pub enum ProtocolsHandlerUpgrErr<TUpgrErr> {
Timeout,
/// There was an error in the timer used.
Timer,
/// The remote muxer denied the attempt to open a substream.
MuxerDeniedSubstream,
/// Error while upgrading the substream to the protocol we want.
Upgrade(UpgradeError<TUpgrErr>),
}
@ -313,9 +311,6 @@ where
ProtocolsHandlerUpgrErr::Timer => {
write!(f, "Timer error while opening a substream")
},
ProtocolsHandlerUpgrErr::MuxerDeniedSubstream => {
write!(f, "Remote muxer denied our attempt to open a substream")
},
ProtocolsHandlerUpgrErr::Upgrade(err) => write!(f, "{}", err),
}
}
@ -329,7 +324,6 @@ where
match self {
ProtocolsHandlerUpgrErr::Timeout => None,
ProtocolsHandlerUpgrErr::Timer => None,
ProtocolsHandlerUpgrErr::MuxerDeniedSubstream => None,
ProtocolsHandlerUpgrErr::Upgrade(err) => Some(err),
}
}

View File

@ -162,9 +162,6 @@ where
#[inline]
fn inject_dial_upgrade_error(&mut self, info: Self::OutboundOpenInfo, error: ProtocolsHandlerUpgrErr<<Self::OutboundProtocol as OutboundUpgrade<Self::Substream>>::Error>) {
match (info, error) {
(EitherOutput::First(info), ProtocolsHandlerUpgrErr::MuxerDeniedSubstream) => {
self.proto1.inject_dial_upgrade_error(info, ProtocolsHandlerUpgrErr::MuxerDeniedSubstream)
},
(EitherOutput::First(info), ProtocolsHandlerUpgrErr::Timer) => {
self.proto1.inject_dial_upgrade_error(info, ProtocolsHandlerUpgrErr::Timer)
},
@ -180,9 +177,6 @@ where
(EitherOutput::First(_), ProtocolsHandlerUpgrErr::Upgrade(UpgradeError::Apply(EitherError::B(_)))) => {
panic!("Wrong API usage; the upgrade error doesn't match the outbound open info");
},
(EitherOutput::Second(info), ProtocolsHandlerUpgrErr::MuxerDeniedSubstream) => {
self.proto2.inject_dial_upgrade_error(info, ProtocolsHandlerUpgrErr::MuxerDeniedSubstream)
},
(EitherOutput::Second(info), ProtocolsHandlerUpgrErr::Timeout) => {
self.proto2.inject_dial_upgrade_error(info, ProtocolsHandlerUpgrErr::Timeout)
},