mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-28 17:21:34 +00:00
Treat EOF error as [`NegotiationError::Failed`], not as [`NegotiationError::ProtocolError`], allowing dropping or closing an I/O stream as a permissible way to "gracefully" fail a negotiation. This is e.g. important when a listener rejects a protocol with [`Message::NotAvailable`] and the dialer does not have alternative protocols to propose. Then the dialer will stop the negotiation and drop the corresponding stream. As a listener this EOF should be interpreted as a failed negotiation.