mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-04-25 11:02:12 +00:00
[multistream-select] Temporarily disable "parallel" negotiation. (#1807)
* [multistream-select] Temp. disable "parallel" negotiation. In order to later change the "ls" responses for spec-compliance. * Update version. * Update misc/multistream-select/CHANGELOG.md Co-authored-by: Max Inden <mail@max-inden.de> Co-authored-by: Max Inden <mail@max-inden.de>
This commit is contained in:
parent
a3d6c8149e
commit
e5adb67d73
@ -1,3 +1,9 @@
|
||||
# 0.8.4 [2020-10-20]
|
||||
|
||||
- Temporarily disable the internal selection of "parallel" protocol
|
||||
negotiation for the dialer to later change the response format of the "ls"
|
||||
message for spec compliance. See https://github.com/libp2p/rust-libp2p/issues/1795.
|
||||
|
||||
# 0.8.3 [2020-10-16]
|
||||
|
||||
- Fix a regression resulting in a panic with the `V1Lazy` protocol.
|
||||
|
@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "multistream-select"
|
||||
description = "Multistream-select negotiation protocol for libp2p"
|
||||
version = "0.8.3"
|
||||
version = "0.8.4"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
license = "MIT"
|
||||
repository = "https://github.com/libp2p/rust-libp2p"
|
||||
|
@ -56,12 +56,17 @@ where
|
||||
I::Item: AsRef<[u8]>
|
||||
{
|
||||
let iter = protocols.into_iter();
|
||||
// NOTE: Temporarily disabled "parallel" negotiation in order to correct the
|
||||
// "ls" responses towards interoperability and (new) spec compliance.
|
||||
// See https://github.com/libp2p/rust-libp2p/issues/1795.
|
||||
Either::Left(dialer_select_proto_serial(inner, iter, version))
|
||||
|
||||
// We choose between the "serial" and "parallel" strategies based on the number of protocols.
|
||||
if iter.size_hint().1.map(|n| n <= 3).unwrap_or(false) {
|
||||
Either::Left(dialer_select_proto_serial(inner, iter, version))
|
||||
} else {
|
||||
Either::Right(dialer_select_proto_parallel(inner, iter, version))
|
||||
}
|
||||
// if iter.size_hint().1.map(|n| n <= 3).unwrap_or(false) {
|
||||
// Either::Left(dialer_select_proto_serial(inner, iter, version))
|
||||
// } else {
|
||||
// Either::Right(dialer_select_proto_parallel(inner, iter, version))
|
||||
// }
|
||||
}
|
||||
|
||||
/// Future, returned by `dialer_select_proto`, which selects a protocol and dialer
|
||||
@ -76,7 +81,7 @@ pub type DialerSelectFuture<R, I> = Either<DialerSelectSeq<R, I>, DialerSelectPa
|
||||
/// trying the given list of supported protocols one-by-one.
|
||||
///
|
||||
/// This strategy is preferable if the dialer only supports a few protocols.
|
||||
pub fn dialer_select_proto_serial<R, I>(
|
||||
pub(crate) fn dialer_select_proto_serial<R, I>(
|
||||
inner: R,
|
||||
protocols: I,
|
||||
version: Version
|
||||
@ -105,7 +110,7 @@ where
|
||||
///
|
||||
/// This strategy may be beneficial if the dialer supports many protocols
|
||||
/// and it is unclear whether the remote supports one of the first few.
|
||||
pub fn dialer_select_proto_parallel<R, I>(
|
||||
pub(crate) fn dialer_select_proto_parallel<R, I>(
|
||||
inner: R,
|
||||
protocols: I,
|
||||
version: Version
|
||||
|
Loading…
x
Reference in New Issue
Block a user