mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-08-01 01:11:58 +00:00
More precise error passed to inject_dial_upgrade_error (#771)
* More precise error passed to inject_dial_upgrade_error * Fix concerns * Fix panic proof
This commit is contained in:
@@ -24,6 +24,7 @@ use libp2p_core::{
|
||||
OutboundUpgrade,
|
||||
ProtocolsHandler,
|
||||
ProtocolsHandlerEvent,
|
||||
protocols_handler::ProtocolsHandlerUpgrErr,
|
||||
upgrade::DeniedUpgrade
|
||||
};
|
||||
use log::warn;
|
||||
@@ -183,7 +184,7 @@ where
|
||||
fn inject_inbound_closed(&mut self) {}
|
||||
|
||||
#[inline]
|
||||
fn inject_dial_upgrade_error(&mut self, _: Self::OutboundOpenInfo, _: io::Error) {
|
||||
fn inject_dial_upgrade_error(&mut self, _: Self::OutboundOpenInfo, _: ProtocolsHandlerUpgrErr<<Self::OutboundProtocol as OutboundUpgrade<Self::Substream>>::Error>) {
|
||||
// In case of error while upgrading, there's not much we can do except shut down.
|
||||
// TODO: we assume that the error is about ping not being supported, which is not
|
||||
// necessarily the case
|
||||
|
@@ -23,8 +23,10 @@ use arrayvec::ArrayVec;
|
||||
use futures::prelude::*;
|
||||
use libp2p_core::{
|
||||
InboundUpgrade,
|
||||
OutboundUpgrade,
|
||||
ProtocolsHandler,
|
||||
ProtocolsHandlerEvent,
|
||||
protocols_handler::ProtocolsHandlerUpgrErr,
|
||||
upgrade::DeniedUpgrade
|
||||
};
|
||||
use log::warn;
|
||||
@@ -101,7 +103,7 @@ where
|
||||
fn inject_inbound_closed(&mut self) {}
|
||||
|
||||
#[inline]
|
||||
fn inject_dial_upgrade_error(&mut self, _: Self::OutboundOpenInfo, _: io::Error) {}
|
||||
fn inject_dial_upgrade_error(&mut self, _: Self::OutboundOpenInfo, _: ProtocolsHandlerUpgrErr<<Self::OutboundProtocol as OutboundUpgrade<Self::Substream>>::Error>) {}
|
||||
|
||||
#[inline]
|
||||
fn shutdown(&mut self) {
|
||||
|
Reference in New Issue
Block a user