mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-25 15:51:34 +00:00
fix(gossipsub): gracefully disable handler on stream errors
Previously, we closed the entire connection upon receiving too many upgrade errors. This is unnecessarily aggressive. For example, an upgrade error may be caused by the remote dropping a stream during the initial handshake which is completely isolated from other protocols running on the same connection. Instead of closing the connection, set `KeepAlive::No`. Related: #3591. Resolves: #3690. Pull-Request: #3625.
This commit is contained in:
@ -134,12 +134,6 @@ impl std::fmt::Display for ValidationError {
|
||||
|
||||
impl std::error::Error for ValidationError {}
|
||||
|
||||
impl From<std::io::Error> for HandlerError {
|
||||
fn from(error: std::io::Error) -> HandlerError {
|
||||
HandlerError::Codec(quick_protobuf_codec::Error::from(error))
|
||||
}
|
||||
}
|
||||
|
||||
impl From<std::io::Error> for PublishError {
|
||||
fn from(error: std::io::Error) -> PublishError {
|
||||
PublishError::TransformFailed(error)
|
||||
|
Reference in New Issue
Block a user