fix: resolve speed bottleneck in 10G network (#451)

Co-authored-by: clxcore <clxcore@gmail.com>
This commit is contained in:
clxcore 2024-09-07 17:57:05 +08:00 committed by GitHub
parent c500ce7acc
commit 2cf6d39032
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)