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,
|
Timeout,
|
||||||
/// There was an error in the timer used.
|
/// There was an error in the timer used.
|
||||||
Timer,
|
Timer,
|
||||||
/// The remote muxer denied the attempt to open a substream.
|
|
||||||
MuxerDeniedSubstream,
|
|
||||||
/// Error while upgrading the substream to the protocol we want.
|
/// Error while upgrading the substream to the protocol we want.
|
||||||
Upgrade(UpgradeError<TUpgrErr>),
|
Upgrade(UpgradeError<TUpgrErr>),
|
||||||
}
|
}
|
||||||
@ -313,9 +311,6 @@ where
|
|||||||
ProtocolsHandlerUpgrErr::Timer => {
|
ProtocolsHandlerUpgrErr::Timer => {
|
||||||
write!(f, "Timer error while opening a substream")
|
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),
|
ProtocolsHandlerUpgrErr::Upgrade(err) => write!(f, "{}", err),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -329,7 +324,6 @@ where
|
|||||||
match self {
|
match self {
|
||||||
ProtocolsHandlerUpgrErr::Timeout => None,
|
ProtocolsHandlerUpgrErr::Timeout => None,
|
||||||
ProtocolsHandlerUpgrErr::Timer => None,
|
ProtocolsHandlerUpgrErr::Timer => None,
|
||||||
ProtocolsHandlerUpgrErr::MuxerDeniedSubstream => None,
|
|
||||||
ProtocolsHandlerUpgrErr::Upgrade(err) => Some(err),
|
ProtocolsHandlerUpgrErr::Upgrade(err) => Some(err),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -162,9 +162,6 @@ where
|
|||||||
#[inline]
|
#[inline]
|
||||||
fn inject_dial_upgrade_error(&mut self, info: Self::OutboundOpenInfo, error: ProtocolsHandlerUpgrErr<<Self::OutboundProtocol as OutboundUpgrade<Self::Substream>>::Error>) {
|
fn inject_dial_upgrade_error(&mut self, info: Self::OutboundOpenInfo, error: ProtocolsHandlerUpgrErr<<Self::OutboundProtocol as OutboundUpgrade<Self::Substream>>::Error>) {
|
||||||
match (info, error) {
|
match (info, error) {
|
||||||
(EitherOutput::First(info), ProtocolsHandlerUpgrErr::MuxerDeniedSubstream) => {
|
|
||||||
self.proto1.inject_dial_upgrade_error(info, ProtocolsHandlerUpgrErr::MuxerDeniedSubstream)
|
|
||||||
},
|
|
||||||
(EitherOutput::First(info), ProtocolsHandlerUpgrErr::Timer) => {
|
(EitherOutput::First(info), ProtocolsHandlerUpgrErr::Timer) => {
|
||||||
self.proto1.inject_dial_upgrade_error(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(_)))) => {
|
(EitherOutput::First(_), ProtocolsHandlerUpgrErr::Upgrade(UpgradeError::Apply(EitherError::B(_)))) => {
|
||||||
panic!("Wrong API usage; the upgrade error doesn't match the outbound open info");
|
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) => {
|
(EitherOutput::Second(info), ProtocolsHandlerUpgrErr::Timeout) => {
|
||||||
self.proto2.inject_dial_upgrade_error(info, ProtocolsHandlerUpgrErr::Timeout)
|
self.proto2.inject_dial_upgrade_error(info, ProtocolsHandlerUpgrErr::Timeout)
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user