Skip to content

Commit

Permalink
*: Update changelogs
Browse files Browse the repository at this point in the history
  • Loading branch information
mxinden committed Aug 25, 2021
1 parent 7d342b6 commit 5853890
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
5 changes: 4 additions & 1 deletion core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@
- Require `ConnectionHandler::{InEvent,OutEvent,Error}` to implement `Debug`
(see [PR 2183]).

- Remove `DisconnectedPeer::set_connected` and `Pool::add` (see [PR 2195]).

- Report `ConnectionLimit` error through `ConnectionError` and thus through
`NetworkEvent::ConnectionClosed` instead of previously through
`PendingConnectionError` and thus `NetworkEvent::{IncomingConnectionError,
DialError}` (see [PR 2191]).

- Remove `DisconnectedPeer::set_connected` and `Pool::add` (see [PR 2195]).
- Report abortion of pending connection through `DialError`,
`UnknownPeerDialError` or `IncomingConnectionError` (see [PR 2191]).

[PR 2145]: https://github.com/libp2p/rust-libp2p/pull/2145
[PR 2142]: https://github.com/libp2p/rust-libp2p/pull/2142
Expand Down
4 changes: 4 additions & 0 deletions swarm-derive/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# 0.25.0 [unreleased]

- Update to latest `libp2p-swarm` changes (see [PR 2191]).

[PR 2191]: https://github.com/libp2p/rust-libp2p/pull/2191

# 0.24.0 [2021-07-12]

- Handle `NetworkBehaviourAction::CloseConnection`. See [PR 2110] for details.
Expand Down
24 changes: 23 additions & 1 deletion swarm/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,34 @@
- Implement `ProtocolsHandler` on `either::Either`representing either of two
`ProtocolsHandler` implementations (see [PR 2192]).

TODO: Mention `inject_dial_failure` now called on DialPeerCondition not met.
- Require implementation to provide handler in
`NetworkBehaviourAction::DialPeer` and `NetworkBehaviourAction::DialAddress`.
Note that the handler is returned to the `NetworkBehaviour` on connection
failure and connection closing. Thus it can be used to carry state, which
otherwise would have to be tracked in the `NetworkBehaviour` itself. E.g. a
message destined to an unconnected peer can be included in the handler, and
thus directly send on connection success or extracted by the
`NetworkBehaviour` on connection failure (see [PR 2191]).

- Include handler in `NetworkBehaviour::inject_dial_failure`,
`NetworkBehaviour::inject_connection_closed`,
`NetworkBehaviour::inject_listen_failure` (see [PR 2191]).

- Include error in `NetworkBehaviour::inject_dial_failure` and call
`NetworkBehaviour::inject_dial_failure` on `DialPeerCondition` evaluating to
false. To emulate the previous behaviour, return early within
`inject_dial_failure` on `DialError::DialPeerConditionFalse`. See [PR 2191].

- Make `NetworkBehaviourAction` generic over `NetworkBehaviour::OutEvent` and
`NetworkBehaviour::ProtocolsHandler`. In most cases, change your generic type
parameters to `NetworkBehaviourAction<Self::OutEvent,
Self::ProtocolsHandler>`. See [PR 2191].

[PR 2150]: https://github.com/libp2p/rust-libp2p/pull/2150
[PR 2182]: https://github.com/libp2p/rust-libp2p/pull/2182
[PR 2183]: https://github.com/libp2p/rust-libp2p/pull/2183
[PR 2192]: https://github.com/libp2p/rust-libp2p/pull/2192
[PR 2191]: https://github.com/libp2p/rust-libp2p/pull/2191

# 0.30.0 [2021-07-12]

Expand Down
2 changes: 1 addition & 1 deletion swarm/src/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ where
THandlerOld: IntoProtocolsHandler,
<THandlerOld as IntoProtocolsHandler>::Handler: ProtocolsHandler<InEvent = TInEvent>,
{
/// Map the handler event.
/// Map the handler.
pub fn map_handler<THandlerNew>(
self,
f: impl FnOnce(THandlerOld) -> THandlerNew,
Expand Down

0 comments on commit 5853890

Please sign in to comment.