Skip to content

Commit bd02305

Browse files
committed
Muxers updated because of changes from Transport::Dial
1 parent 7e7f40b commit bd02305

File tree

3 files changed

+27
-21
lines changed

3 files changed

+27
-21
lines changed

libp2p/CHANGELOG.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 0.56.2
2+
3+
- changes to `SelectMuxerUpgrade` and `SelectSecurityUpgrade` due to changes in the `Transport::Dial` future
4+
which returns PortUse policy.
5+
See [PR ]
6+
17
## 0.56.1
28

39
- Fix `metrics` delegation to gossipsub protocol.
@@ -8,12 +14,12 @@
814
- Remove `async-std` support.
915
See [PR 6074](https://github.com/libp2p/rust-libp2p/pull/6074)
1016
- Remove deprecated `Transport::with_bandwidth_logging`,
11-
`SwarmBuilder::with_bandwidth_logging` and `TransportExt`.
17+
`SwarmBuilder::with_bandwidth_logging` and `TransportExt`.
1218
See [PR 5766](https://github.com/libp2p/rust-libp2p/pull/5766).
1319

1420
- Introduce `libp2p-webrtc-websys` behind `webrtc-websys` feature flag.
1521
See [PR 5819](https://github.com/libp2p/rust-libp2p/pull/5819).
16-
22+
1723
- Introduce `libp2p-peer-store`.
1824
See [PR 5724](https://github.com/libp2p/rust-libp2p/pull/5724).
1925

@@ -28,7 +34,7 @@
2834

2935
- Remove DNS from the `async-std` swarm builder, as `async-std` support was removed from `libp2p-dns` transport.
3036
See [PR 5959](https://github.com/libp2p/rust-libp2p/pull/5959)
31-
37+
3238
## 0.55.0
3339

3440
- Raise MSRV to 1.83.0.
@@ -46,11 +52,11 @@
4652
- Expose swarm builder phase errors.
4753
See [PR 5726](https://github.com/libp2p/rust-libp2p/pull/5726).
4854

49-
- Deprecate `ConnectionHandler::{InboundOpenInfo, OutboundOpenInfo}` associated type.
50-
Previously, users could tag pending sub streams with custom data and retrieve the data
55+
- Deprecate `ConnectionHandler::{InboundOpenInfo, OutboundOpenInfo}` associated type.
56+
Previously, users could tag pending sub streams with custom data and retrieve the data
5157
after the substream has been negotiated.
52-
But substreams themselves are completely interchangeable, users should instead track
53-
additional data inside `ConnectionHandler` after negotiation.
58+
But substreams themselves are completely interchangeable, users should instead track
59+
additional data inside `ConnectionHandler` after negotiation.
5460
See [PR 5242](https://github.com/libp2p/rust-libp2p/pull/5242).
5561

5662
<!-- Update to libp2p-core v0.43.0 -->

libp2p/src/builder/select_muxer.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use std::iter::{Chain, Map};
2525
use either::Either;
2626
use futures::future;
2727
use libp2p_core::{
28-
either::EitherFuture,
28+
either::EitherUpgradeFuture,
2929
upgrade::{InboundConnectionUpgrade, OutboundConnectionUpgrade},
3030
UpgradeInfo,
3131
};
@@ -74,12 +74,12 @@ where
7474
{
7575
type Output = future::Either<TA, TB>;
7676
type Error = Either<EA, EB>;
77-
type Future = EitherFuture<A::Future, B::Future>;
77+
type Future = EitherUpgradeFuture<A::Future, B::Future>;
7878

7979
fn upgrade_inbound(self, sock: C, info: Self::Info) -> Self::Future {
8080
match info {
81-
Either::Left(info) => EitherFuture::First(self.0.upgrade_inbound(sock, info)),
82-
Either::Right(info) => EitherFuture::Second(self.1.upgrade_inbound(sock, info)),
81+
Either::Left(info) => EitherUpgradeFuture::First(self.0.upgrade_inbound(sock, info)),
82+
Either::Right(info) => EitherUpgradeFuture::Second(self.1.upgrade_inbound(sock, info)),
8383
}
8484
}
8585
}
@@ -91,12 +91,12 @@ where
9191
{
9292
type Output = future::Either<TA, TB>;
9393
type Error = Either<EA, EB>;
94-
type Future = EitherFuture<A::Future, B::Future>;
94+
type Future = EitherUpgradeFuture<A::Future, B::Future>;
9595

9696
fn upgrade_outbound(self, sock: C, info: Self::Info) -> Self::Future {
9797
match info {
98-
Either::Left(info) => EitherFuture::First(self.0.upgrade_outbound(sock, info)),
99-
Either::Right(info) => EitherFuture::Second(self.1.upgrade_outbound(sock, info)),
98+
Either::Left(info) => EitherUpgradeFuture::First(self.0.upgrade_outbound(sock, info)),
99+
Either::Right(info) => EitherUpgradeFuture::Second(self.1.upgrade_outbound(sock, info)),
100100
}
101101
}
102102
}

libp2p/src/builder/select_security.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use std::iter::{Chain, Map};
2626
use either::Either;
2727
use futures::{future, future::MapOk, TryFutureExt};
2828
use libp2p_core::{
29-
either::EitherFuture,
29+
either::EitherUpgradeFuture,
3030
upgrade::{InboundConnectionUpgrade, OutboundConnectionUpgrade, UpgradeInfo},
3131
};
3232
use libp2p_identity::PeerId;
@@ -83,14 +83,14 @@ where
8383
type Output = (PeerId, future::Either<TA, TB>);
8484
type Error = Either<EA, EB>;
8585
type Future = MapOk<
86-
EitherFuture<A::Future, B::Future>,
86+
EitherUpgradeFuture<A::Future, B::Future>,
8787
fn(future::Either<(PeerId, TA), (PeerId, TB)>) -> (PeerId, future::Either<TA, TB>),
8888
>;
8989

9090
fn upgrade_inbound(self, sock: C, info: Self::Info) -> Self::Future {
9191
match info {
92-
Either::Left(info) => EitherFuture::First(self.0.upgrade_inbound(sock, info)),
93-
Either::Right(info) => EitherFuture::Second(self.1.upgrade_inbound(sock, info)),
92+
Either::Left(info) => EitherUpgradeFuture::First(self.0.upgrade_inbound(sock, info)),
93+
Either::Right(info) => EitherUpgradeFuture::Second(self.1.upgrade_inbound(sock, info)),
9494
}
9595
.map_ok(future::Either::factor_first)
9696
}
@@ -104,14 +104,14 @@ where
104104
type Output = (PeerId, future::Either<TA, TB>);
105105
type Error = Either<EA, EB>;
106106
type Future = MapOk<
107-
EitherFuture<A::Future, B::Future>,
107+
EitherUpgradeFuture<A::Future, B::Future>,
108108
fn(future::Either<(PeerId, TA), (PeerId, TB)>) -> (PeerId, future::Either<TA, TB>),
109109
>;
110110

111111
fn upgrade_outbound(self, sock: C, info: Self::Info) -> Self::Future {
112112
match info {
113-
Either::Left(info) => EitherFuture::First(self.0.upgrade_outbound(sock, info)),
114-
Either::Right(info) => EitherFuture::Second(self.1.upgrade_outbound(sock, info)),
113+
Either::Left(info) => EitherUpgradeFuture::First(self.0.upgrade_outbound(sock, info)),
114+
Either::Right(info) => EitherUpgradeFuture::Second(self.1.upgrade_outbound(sock, info)),
115115
}
116116
.map_ok(future::Either::factor_first)
117117
}

0 commit comments

Comments
 (0)