From ab4fe4566e759ca8bea814cc1a4eff93038de5bb Mon Sep 17 00:00:00 2001 From: Max Inden Date: Thu, 3 Jun 2021 11:04:33 +0200 Subject: [PATCH] src/lib: Default to WindowUpdateMode::OnRead Default to `WindowUpdateMode::OnRead`, thus enabling full Yamux flow-control, exercising back pressure on senders, preventing stream resets due to reaching the buffer limit. See the [`WindowUpdateMode` documentation] for details, especially the section on deadlocking when sending data larger than the receivers window. [`WindowUpdateMode` documentation]: https://docs.rs/yamux/0.9.0/yamux/enum.WindowUpdateMode.html --- CHANGELOG.md | 11 +++++++++++ Cargo.toml | 2 +- src/lib.rs | 4 ++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cebc558e..5e791d5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +# 0.10.0 [unreleased] + +- Default to `WindowUpdateMode::OnRead`, thus enabling full Yamux flow-control, + exercising back pressure on senders, preventing stream resets due to reaching + the buffer limit. + + See the [`WindowUpdateMode` documentation] for details, especially the section + on deadlocking when sending data larger than the receivers window. + + [`WindowUpdateMode` documentation]: https://docs.rs/yamux/0.9.0/yamux/enum.WindowUpdateMode.html + # 0.9.0 - Force-split larger frames, for better interleaving of diff --git a/Cargo.toml b/Cargo.toml index e8114653..648dc92e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "yamux" -version = "0.9.0" +version = "0.10.0" authors = ["Parity Technologies "] license = "Apache-2.0 OR MIT" description = "Multiplexer over reliable, ordered connections" diff --git a/src/lib.rs b/src/lib.rs index b2a8740c..28e5a499 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -90,7 +90,7 @@ pub enum WindowUpdateMode { /// - receive window = 256 KiB /// - max. buffer size (per stream) = 1 MiB /// - max. number of streams = 8192 -/// - window update mode = on receive +/// - window update mode = on read /// - read after close = true /// - split send size = 16 KiB #[derive(Debug, Clone)] @@ -109,7 +109,7 @@ impl Default for Config { receive_window: DEFAULT_CREDIT, max_buffer_size: 1024 * 1024, max_num_streams: 8192, - window_update_mode: WindowUpdateMode::OnReceive, + window_update_mode: WindowUpdateMode::OnRead, read_after_close: true, split_send_size: DEFAULT_SPLIT_SEND_SIZE }