Change the window mode of yamux (#2390)
This commit is contained in:
parent
6fb48b45fa
commit
f4bc9db16d
@ -375,13 +375,17 @@ fn build_transport(
|
|||||||
mplex_config.set_max_buffer_size(256);
|
mplex_config.set_max_buffer_size(256);
|
||||||
mplex_config.set_max_buffer_behaviour(libp2p::mplex::MaxBufferBehaviour::Block);
|
mplex_config.set_max_buffer_behaviour(libp2p::mplex::MaxBufferBehaviour::Block);
|
||||||
|
|
||||||
|
// yamux config
|
||||||
|
let mut yamux_config = libp2p::yamux::YamuxConfig::default();
|
||||||
|
yamux_config.set_window_update_mode(libp2p::yamux::WindowUpdateMode::on_read());
|
||||||
|
|
||||||
// Authentication
|
// Authentication
|
||||||
Ok((
|
Ok((
|
||||||
transport
|
transport
|
||||||
.upgrade(core::upgrade::Version::V1)
|
.upgrade(core::upgrade::Version::V1)
|
||||||
.authenticate(generate_noise_config(&local_private_key))
|
.authenticate(generate_noise_config(&local_private_key))
|
||||||
.multiplex(core::upgrade::SelectUpgrade::new(
|
.multiplex(core::upgrade::SelectUpgrade::new(
|
||||||
libp2p::yamux::YamuxConfig::default(),
|
yamux_config,
|
||||||
mplex_config,
|
mplex_config,
|
||||||
))
|
))
|
||||||
.timeout(Duration::from_secs(10))
|
.timeout(Duration::from_secs(10))
|
||||||
|
Loading…
Reference in New Issue
Block a user