mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-14 10:31:21 +00:00
Re-enable 'parallel negotiation'. (#1934)
Based on an estimate of the number of alternative protocols the dialer supports.
This commit is contained in:
@ -56,17 +56,12 @@ where
|
|||||||
I::Item: AsRef<[u8]>
|
I::Item: AsRef<[u8]>
|
||||||
{
|
{
|
||||||
let iter = protocols.into_iter();
|
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.
|
// 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) {
|
if iter.size_hint().1.map(|n| n <= 3).unwrap_or(false) {
|
||||||
// Either::Left(dialer_select_proto_serial(inner, iter, version))
|
Either::Left(dialer_select_proto_serial(inner, iter, version))
|
||||||
// } else {
|
} else {
|
||||||
// Either::Right(dialer_select_proto_parallel(inner, iter, version))
|
Either::Right(dialer_select_proto_parallel(inner, iter, version))
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Future, returned by `dialer_select_proto`, which selects a protocol and dialer
|
/// Future, returned by `dialer_select_proto`, which selects a protocol and dialer
|
||||||
|
Reference in New Issue
Block a user