mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-27 16:51:34 +00:00
Remove ProtocolsHandlerUpgrErr::MuxerDeniedSubstream
. (#1043)
Closes #1042.
This commit is contained in:
@ -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),
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
},
|
||||
|
Reference in New Issue
Block a user