- Update dependencies.
-
Require a
Boxed
transport to be given to theSwarm
orSwarmBuilder
to avoid unnecessary double-boxing of transports and simplify API bounds. PR 1794 -
Respect inbound timeouts and upgrade versions in the
MultiHandler
. PR 1786. -
Instead of iterating each inbound and outbound substream upgrade looking for one to make progress, use a
FuturesUnordered
for both pending inbound and pending outbound upgrades. As a result only those upgrades are polled that are ready to progress.Implementors of
InboundUpgrade
andOutboundUpgrade
need to ensure to wake up the underlying task once they are ready to make progress as they won't be polled otherwise.
-
Bump
libp2p-core
dependency. -
Adds
ProtocolsHandler::InboundOpenInfo
type which mirrors the existingOutboundOpenInfo
type. A value of this type is passed as an extra argument toProtocolsHandler::inject_fully_negotiated_inbound
andProtocolsHandler::inject_listen_upgrade_error
. -
SubstreamProtocol
now has a second type parameter corresponding to inbound or outbound information, a value of which is part ofSubstreamProtocol
now. ConsequentlyProtocolsHandlerEvent::OutboundSubstreamRequest
no longer has a separateinfo
field.
-
Add missing delegation calls in some
ProtocolsHandler
wrappers. See PR 1710. -
Add as_ref and as_mut functions to Toggle PR 1684.
-
The
cause
ofSwarmEvent::ConnectionClosed
is now anOption
, andNone
indicates an active connection close not caused by an error. -
DialError::Banned
has been added and is returned fromSwarm::dial
if the peer is banned, thereby also invoking theNetworkBehaviour::inject_dial_failure
callback. -
Update the
libp2p-core
dependency to0.21
, fixing 1584. -
Fix connections being kept alive by
OneShotHandler
when not handling any requests PR 1698.
-
Documentation updates.
-
Ignore addresses returned by
NetworkBehaviour::addresses_of_peer
that theSwarm
considers to be listening addresses of the local node. This avoids futile dialing attempts of a node to itself, which can otherwise even happen in genuine situations, e.g. after the local node changed its network identity and a behaviour makes a dialing attempt to a former identity using the same addresses.
-
Updated the
libp2p-core
dependency. -
Add
ProtocolsHandler::inject_listen_upgrade_error
, the inbound analogue ofProtocolsHandler::inject_dial_upgrade_error
, with an empty default implementation. No implementation is required to retain existing behaviour. -
Add
ProtocolsHandler::inject_address_change
andNetworkBehaviour::inject_address_change
to notify of a change in the address of an existing connection.
- Bugfix: Fix MultiHandler panicking when empty (PR 1598).