Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[multistream-select] Re-enable 'parallel negotiation'. #1934

Merged
merged 2 commits into from
Mar 1, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions misc/multistream-select/src/dialer_select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,12 @@ 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
Expand Down