mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 08:51:09 +00:00
client/network: Remove option to disable yamux flow control (#7358)
With the `OnRead` flow control option yamux "send[s] window updates only when data is read on the receiving end" and not as soon as "a Stream's receive window drops to 0". Yamux flow control has proven itself. This commit removes the feature flag. Yamux flow control is now always enabled.
This commit is contained in:
@@ -41,7 +41,6 @@ pub fn build_transport(
|
||||
keypair: identity::Keypair,
|
||||
memory_only: bool,
|
||||
wasm_external_transport: Option<wasm_ext::ExtTransport>,
|
||||
use_yamux_flow_control: bool
|
||||
) -> (Boxed<(PeerId, StreamMuxerBox), io::Error>, Arc<BandwidthSinks>) {
|
||||
// Build the base layer of the transport.
|
||||
let transport = if let Some(t) = wasm_external_transport {
|
||||
@@ -109,12 +108,9 @@ pub fn build_transport(
|
||||
mplex_config.max_buffer_len(usize::MAX);
|
||||
|
||||
let mut yamux_config = libp2p::yamux::Config::default();
|
||||
|
||||
if use_yamux_flow_control {
|
||||
// Enable proper flow-control: window updates are only sent when
|
||||
// buffered data has been consumed.
|
||||
yamux_config.set_window_update_mode(libp2p::yamux::WindowUpdateMode::OnRead);
|
||||
}
|
||||
// Enable proper flow-control: window updates are only sent when
|
||||
// buffered data has been consumed.
|
||||
yamux_config.set_window_update_mode(libp2p::yamux::WindowUpdateMode::OnRead);
|
||||
|
||||
core::upgrade::SelectUpgrade::new(yamux_config, mplex_config)
|
||||
.map_inbound(move |muxer| core::muxing::StreamMuxerBox::new(muxer))
|
||||
|
||||
Reference in New Issue
Block a user