mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-07-02 03:01:33 +00:00
refactor(dcutr): don't use OutboundOpenInfo
In a previous refactoring, we actually removed the usage of this openinfo so this is just removing dead code. Related: #3268. Pull-Request: #3762.
This commit is contained in:
@ -133,7 +133,6 @@ impl Behaviour {
|
||||
handler: NotifyHandler::One(connection_id),
|
||||
event: Either::Left(handler::relayed::Command::Connect {
|
||||
obs_addrs: self.observed_addreses(),
|
||||
attempt: 1,
|
||||
}),
|
||||
},
|
||||
ToSwarm::GenerateEvent(Event::InitiatedDirectConnectionUpgrade {
|
||||
@ -190,7 +189,6 @@ impl Behaviour {
|
||||
handler: NotifyHandler::One(relayed_connection_id),
|
||||
peer_id,
|
||||
event: Either::Left(handler::relayed::Command::Connect {
|
||||
attempt: attempt + 1,
|
||||
obs_addrs: self.observed_addreses(),
|
||||
}),
|
||||
})
|
||||
|
@ -44,7 +44,6 @@ use std::time::Duration;
|
||||
pub enum Command {
|
||||
Connect {
|
||||
obs_addrs: Vec<Multiaddr>,
|
||||
attempt: u8,
|
||||
},
|
||||
AcceptInboundConnect {
|
||||
obs_addrs: Vec<Multiaddr>,
|
||||
@ -59,10 +58,9 @@ pub enum Command {
|
||||
impl fmt::Debug for Command {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match self {
|
||||
Command::Connect { obs_addrs, attempt } => f
|
||||
Command::Connect { obs_addrs } => f
|
||||
.debug_struct("Command::Connect")
|
||||
.field("obs_addrs", obs_addrs)
|
||||
.field("attempt", attempt)
|
||||
.finish(),
|
||||
Command::AcceptInboundConnect {
|
||||
obs_addrs,
|
||||
@ -301,7 +299,7 @@ impl ConnectionHandler for Handler {
|
||||
>;
|
||||
type InboundProtocol = Either<protocol::inbound::Upgrade, DeniedUpgrade>;
|
||||
type OutboundProtocol = protocol::outbound::Upgrade;
|
||||
type OutboundOpenInfo = u8; // Number of upgrade attempts.
|
||||
type OutboundOpenInfo = ();
|
||||
type InboundOpenInfo = ();
|
||||
|
||||
fn listen_protocol(&self) -> SubstreamProtocol<Self::InboundProtocol, Self::InboundOpenInfo> {
|
||||
@ -322,12 +320,12 @@ impl ConnectionHandler for Handler {
|
||||
|
||||
fn on_behaviour_event(&mut self, event: Self::InEvent) {
|
||||
match event {
|
||||
Command::Connect { obs_addrs, attempt } => {
|
||||
Command::Connect { obs_addrs } => {
|
||||
self.queued_events
|
||||
.push_back(ConnectionHandlerEvent::OutboundSubstreamRequest {
|
||||
protocol: SubstreamProtocol::new(
|
||||
protocol::outbound::Upgrade::new(obs_addrs),
|
||||
attempt,
|
||||
(),
|
||||
),
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user