mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-05-23 16:11:19 +00:00
fix(ping): remove debug_assert on protocol negotiation timeout
The negotiation of the ping protocol can timeout, thus a debug_assert is not correct. Return an `std::io::Error` instead. Pull-Request: #3995.
This commit is contained in:
parent
a8a00e7ad7
commit
efb117e236
@ -196,10 +196,12 @@ impl Handler {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Note: This timeout only covers protocol negotiation.
|
// Note: This timeout only covers protocol negotiation.
|
||||||
StreamUpgradeError::Timeout => {
|
StreamUpgradeError::Timeout => Failure::Other {
|
||||||
debug_assert!(false, "ReadyUpgrade cannot time out");
|
error: Box::new(std::io::Error::new(
|
||||||
return;
|
std::io::ErrorKind::TimedOut,
|
||||||
}
|
"ping protocol negotiation timed out",
|
||||||
|
)),
|
||||||
|
},
|
||||||
StreamUpgradeError::Apply(e) => void::unreachable(e),
|
StreamUpgradeError::Apply(e) => void::unreachable(e),
|
||||||
StreamUpgradeError::Io(e) => Failure::Other { error: Box::new(e) },
|
StreamUpgradeError::Io(e) => Failure::Other { error: Box::new(e) },
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user