From 2cf6d3903224cd5b42b7d5b18dc25ee76acfd350 Mon Sep 17 00:00:00 2001 From: clxcore Date: Sat, 7 Sep 2024 17:57:05 +0800 Subject: [PATCH] fix: resolve speed bottleneck in 10G network (#451) Co-authored-by: clxcore --- src/server.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server.rs b/src/server.rs index 2343fe5..4641fbe 100644 --- a/src/server.rs +++ b/src/server.rs @@ -682,7 +682,7 @@ impl Server { error!("Failed to zip {}, {}", path.display(), e); } }); - let reader_stream = ReaderStream::new(reader); + let reader_stream = ReaderStream::with_capacity(reader, BUF_SIZE); let stream_body = StreamBody::new( reader_stream .map_ok(Frame::data) @@ -899,7 +899,7 @@ impl Server { return Ok(()); } - let reader_stream = ReaderStream::new(file); + let reader_stream = ReaderStream::with_capacity(file, BUF_SIZE); let stream_body = StreamBody::new( reader_stream .map_ok(Frame::data)