Skip to content

Commit f0170b9

Browse files
Allow reporting of supported protocols by remote
1 parent 6fca1b0 commit f0170b9

File tree

23 files changed

+132
-34
lines changed

23 files changed

+132
-34
lines changed

protocols/dcutr/src/handler/direct.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ impl ConnectionHandler for Handler {
9393
| ConnectionEvent::DialUpgradeError(_)
9494
| ConnectionEvent::ListenUpgradeError(_)
9595
| ConnectionEvent::AddressChange(_)
96-
| ConnectionEvent::ProtocolsChange(_) => {}
96+
| ConnectionEvent::LocalProtocolsChange(_)
97+
| ConnectionEvent::RemoteProtocolsChange(_) => {}
9798
}
9899
}
99100
}

protocols/dcutr/src/handler/relayed.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,9 @@ impl ConnectionHandler for Handler {
419419
ConnectionEvent::DialUpgradeError(dial_upgrade_error) => {
420420
self.on_dial_upgrade_error(dial_upgrade_error)
421421
}
422-
ConnectionEvent::AddressChange(_) | ConnectionEvent::ProtocolsChange(_) => {}
422+
ConnectionEvent::AddressChange(_)
423+
| ConnectionEvent::LocalProtocolsChange(_)
424+
| ConnectionEvent::RemoteProtocolsChange(_) => {}
423425
}
424426
}
425427
}

protocols/gossipsub/src/handler.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,8 @@ impl ConnectionHandler for Handler {
578578
}
579579
ConnectionEvent::AddressChange(_)
580580
| ConnectionEvent::ListenUpgradeError(_)
581-
| ConnectionEvent::ProtocolsChange(_) => {}
581+
| ConnectionEvent::LocalProtocolsChange(_)
582+
| ConnectionEvent::RemoteProtocolsChange(_) => {}
582583
}
583584
}
584585
}

protocols/identify/src/handler.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,11 +345,12 @@ impl ConnectionHandler for Handler {
345345
self.on_dial_upgrade_error(dial_upgrade_error)
346346
}
347347
ConnectionEvent::AddressChange(_) | ConnectionEvent::ListenUpgradeError(_) => {}
348-
ConnectionEvent::ProtocolsChange(_) => {
348+
ConnectionEvent::LocalProtocolsChange(_) => {
349349
// TODO:
350350
// 1. push protocol changes
351351
// 2. store protocols locally and use it to answer next identify request
352352
}
353+
ConnectionEvent::RemoteProtocolsChange(_) => {}
353354
}
354355
}
355356
}

protocols/kad/src/handler.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,8 @@ where
788788
}
789789
ConnectionEvent::AddressChange(_)
790790
| ConnectionEvent::ListenUpgradeError(_)
791-
| ConnectionEvent::ProtocolsChange(_) => {}
791+
| ConnectionEvent::LocalProtocolsChange(_)
792+
| ConnectionEvent::RemoteProtocolsChange(_) => {}
792793
}
793794
}
794795
}

protocols/perf/src/client/handler.rs

Lines changed: 2 additions & 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(_) | ConnectionEvent::ProtocolsChange(_) => {}
130+
ConnectionEvent::AddressChange(_) | ConnectionEvent::LocalProtocolsChange(_) => {}
131131
ConnectionEvent::DialUpgradeError(DialUpgradeError {
132132
info: Command { id, .. },
133133
error,
@@ -147,6 +147,7 @@ impl ConnectionHandler for Handler {
147147
},
148148
}
149149
}
150+
ConnectionEvent::RemoteProtocolsChange(_) => {}
150151
}
151152
}
152153

protocols/perf/src/server/handler.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ impl ConnectionHandler for Handler {
104104
ConnectionEvent::DialUpgradeError(DialUpgradeError { info, .. }) => {
105105
void::unreachable(info)
106106
}
107-
ConnectionEvent::AddressChange(_) | ConnectionEvent::ProtocolsChange(_) => {}
107+
ConnectionEvent::AddressChange(_)
108+
| ConnectionEvent::LocalProtocolsChange(_)
109+
| ConnectionEvent::RemoteProtocolsChange(_) => {}
108110
ConnectionEvent::ListenUpgradeError(ListenUpgradeError { info: (), error }) => {
109111
match error {
110112
ConnectionHandlerUpgrErr::Timeout => {}

protocols/ping/src/handler.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,8 @@ impl ConnectionHandler for Handler {
413413
}
414414
ConnectionEvent::AddressChange(_)
415415
| ConnectionEvent::ListenUpgradeError(_)
416-
| ConnectionEvent::ProtocolsChange(_) => {}
416+
| ConnectionEvent::LocalProtocolsChange(_)
417+
| ConnectionEvent::RemoteProtocolsChange(_) => {}
417418
}
418419
}
419420
}

protocols/relay/src/behaviour/handler.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,9 @@ impl ConnectionHandler for Handler {
954954
ConnectionEvent::DialUpgradeError(dial_upgrade_error) => {
955955
self.on_dial_upgrade_error(dial_upgrade_error)
956956
}
957-
ConnectionEvent::AddressChange(_) | ConnectionEvent::ProtocolsChange(_) => {}
957+
ConnectionEvent::AddressChange(_)
958+
| ConnectionEvent::LocalProtocolsChange(_)
959+
| ConnectionEvent::RemoteProtocolsChange(_) => {}
958960
}
959961
}
960962
}

protocols/relay/src/priv_client/handler.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,9 @@ impl ConnectionHandler for Handler {
613613
ConnectionEvent::DialUpgradeError(dial_upgrade_error) => {
614614
self.on_dial_upgrade_error(dial_upgrade_error)
615615
}
616-
ConnectionEvent::AddressChange(_) | ConnectionEvent::ProtocolsChange(_) => {}
616+
ConnectionEvent::AddressChange(_)
617+
| ConnectionEvent::LocalProtocolsChange(_)
618+
| ConnectionEvent::RemoteProtocolsChange(_) => {}
617619
}
618620
}
619621
}

0 commit comments

Comments
 (0)