Skip to content

Commit f2801fb

Browse files
Report changes in supported protocols back to ConnectionHandler
1 parent dcbc04e commit f2801fb

File tree

22 files changed

+213
-21
lines changed

22 files changed

+213
-21
lines changed

protocols/dcutr/src/handler/direct.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ impl ConnectionHandler for Handler {
9292
| ConnectionEvent::FullyNegotiatedOutbound(_)
9393
| ConnectionEvent::DialUpgradeError(_)
9494
| ConnectionEvent::ListenUpgradeError(_)
95-
| ConnectionEvent::AddressChange(_) => {}
95+
| ConnectionEvent::AddressChange(_)
96+
| ConnectionEvent::ProtocolsChange(_) => {}
9697
}
9798
}
9899
}

protocols/dcutr/src/handler/relayed.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ impl ConnectionHandler for Handler {
419419
ConnectionEvent::DialUpgradeError(dial_upgrade_error) => {
420420
self.on_dial_upgrade_error(dial_upgrade_error)
421421
}
422-
ConnectionEvent::AddressChange(_) => {}
422+
ConnectionEvent::AddressChange(_) | ConnectionEvent::ProtocolsChange(_) => {}
423423
}
424424
}
425425
}

protocols/gossipsub/src/handler.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,9 @@ impl ConnectionHandler for Handler {
576576
warn!("Dial upgrade error {:?}", e);
577577
self.upgrade_errors.push_back(e);
578578
}
579-
ConnectionEvent::AddressChange(_) | ConnectionEvent::ListenUpgradeError(_) => {}
579+
ConnectionEvent::AddressChange(_)
580+
| ConnectionEvent::ListenUpgradeError(_)
581+
| ConnectionEvent::ProtocolsChange(_) => {}
580582
}
581583
}
582584
}

protocols/identify/src/handler.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,9 @@ impl ConnectionHandler for Handler {
344344
ConnectionEvent::DialUpgradeError(dial_upgrade_error) => {
345345
self.on_dial_upgrade_error(dial_upgrade_error)
346346
}
347-
ConnectionEvent::AddressChange(_) | ConnectionEvent::ListenUpgradeError(_) => {}
347+
ConnectionEvent::AddressChange(_)
348+
| ConnectionEvent::ListenUpgradeError(_)
349+
| ConnectionEvent::ProtocolsChange(_) => {}
348350
}
349351
}
350352
}

protocols/kad/src/handler.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,9 @@ where
786786
ConnectionEvent::DialUpgradeError(dial_upgrade_error) => {
787787
self.on_dial_upgrade_error(dial_upgrade_error)
788788
}
789-
ConnectionEvent::AddressChange(_) | ConnectionEvent::ListenUpgradeError(_) => {}
789+
ConnectionEvent::AddressChange(_)
790+
| ConnectionEvent::ListenUpgradeError(_)
791+
| ConnectionEvent::ProtocolsChange(_) => {}
790792
}
791793
}
792794
}

protocols/perf/src/client/handler.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ impl ConnectionHandler for Handler {
127127
.boxed(),
128128
),
129129

130-
ConnectionEvent::AddressChange(_) => {}
130+
ConnectionEvent::AddressChange(_) | ConnectionEvent::ProtocolsChange(_) => {}
131131
ConnectionEvent::DialUpgradeError(DialUpgradeError {
132132
info: Command { id, .. },
133133
error,

protocols/perf/src/server/handler.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ impl ConnectionHandler for Handler {
104104
ConnectionEvent::DialUpgradeError(DialUpgradeError { info, .. }) => {
105105
void::unreachable(info)
106106
}
107-
ConnectionEvent::AddressChange(_) => {}
107+
ConnectionEvent::AddressChange(_) | ConnectionEvent::ProtocolsChange(_) => {}
108108
ConnectionEvent::ListenUpgradeError(ListenUpgradeError { info: (), error }) => {
109109
match error {
110110
ConnectionHandlerUpgrErr::Timeout => {}

protocols/ping/src/handler.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,9 @@ impl ConnectionHandler for Handler {
411411
ConnectionEvent::DialUpgradeError(dial_upgrade_error) => {
412412
self.on_dial_upgrade_error(dial_upgrade_error)
413413
}
414-
ConnectionEvent::AddressChange(_) | ConnectionEvent::ListenUpgradeError(_) => {}
414+
ConnectionEvent::AddressChange(_)
415+
| ConnectionEvent::ListenUpgradeError(_)
416+
| ConnectionEvent::ProtocolsChange(_) => {}
415417
}
416418
}
417419
}

protocols/relay/src/behaviour/handler.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,7 @@ impl ConnectionHandler for Handler {
954954
ConnectionEvent::DialUpgradeError(dial_upgrade_error) => {
955955
self.on_dial_upgrade_error(dial_upgrade_error)
956956
}
957-
ConnectionEvent::AddressChange(_) => {}
957+
ConnectionEvent::AddressChange(_) | ConnectionEvent::ProtocolsChange(_) => {}
958958
}
959959
}
960960
}

protocols/relay/src/priv_client/handler.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ impl ConnectionHandler for Handler {
613613
ConnectionEvent::DialUpgradeError(dial_upgrade_error) => {
614614
self.on_dial_upgrade_error(dial_upgrade_error)
615615
}
616-
ConnectionEvent::AddressChange(_) => {}
616+
ConnectionEvent::AddressChange(_) | ConnectionEvent::ProtocolsChange(_) => {}
617617
}
618618
}
619619
}

0 commit comments

Comments
 (0)