mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-30 10:11:33 +00:00
protocols/ping: Don't force close conn if not supported by remote (#2149)
Don't close connection if ping protocol is unsupported by remote. Previously, a failed protocol negotation for ping caused a force close of the connection. As a result, all nodes in a network had to support ping. To allow networks where some nodes don't support ping, we now emit `PingFailure::Unsupported` once for every connection on which ping is not supported. Co-authored-by: Max Inden <mail@max-inden.de>
This commit is contained in:
@ -223,6 +223,12 @@ fn main() -> Result<(), Box<dyn Error>> {
|
||||
} => {
|
||||
println!("ping: timeout to {}", peer.to_base58());
|
||||
}
|
||||
PingEvent {
|
||||
peer,
|
||||
result: Result::Err(PingFailure::Unsupported),
|
||||
} => {
|
||||
println!("ping: {} does not support ping protocol", peer.to_base58());
|
||||
}
|
||||
PingEvent {
|
||||
peer,
|
||||
result: Result::Err(PingFailure::Other { error }),
|
||||
|
Reference in New Issue
Block a user