An open-source cross-platform alternative to AirDrop
fix: reduce file stream read-ahead (#3424)
luo jiyine10e6250b18b
diff --git a/packages/core/src/model/transfer.rs b/packages/core/src/model/transfer.rsindex f5b441a7..7b2f90d7 100644--- a/packages/core/src/model/transfer.rs+++ b/packages/core/src/model/transfer.rs@@ -3,8 +3,8 @@ use serde::{Deserialize, Serialize};use std::path::PathBuf;use tokio::sync::mpsc;-/// Channel capacity used when normalizing a file-backed [`FileContent`] into a stream.-const FILE_CHANNEL_CAPACITY: usize = 16;+/// Limit queued file read-ahead to 2 MiB per active stream.+const FILE_CHANNEL_CAPACITY: usize = 4;/// Buffer size used when reading a file into chunks.const READ_BUFFER_SIZE: usize = 512 * 1024;