diff --git a/src/client/pxar_backup_stream.rs b/src/client/pxar_backup_stream.rs index 9b3246db..dffdd589 100644 --- a/src/client/pxar_backup_stream.rs +++ b/src/client/pxar_backup_stream.rs @@ -37,11 +37,14 @@ impl Drop for PxarBackupStream { impl PxarBackupStream { pub fn new(mut dir: Dir, path: PathBuf, all_file_systems: bool, verbose: bool) -> Result { - let mut buffer = Vec::with_capacity(4096); + let buffer_size = 1024*1024; + let mut buffer = Vec::with_capacity(buffer_size); unsafe { buffer.set_len(buffer.capacity()); } let (rx, tx) = nix::unistd::pipe()?; + nix::fcntl::fcntl(rx, nix::fcntl::FcntlArg::F_SETPIPE_SZ(buffer_size as i32))?; + let child = thread::spawn(move|| { let mut writer = unsafe { std::fs::File::from_raw_fd(tx) }; if let Err(err) = pxar::Encoder::encode(path, &mut dir, &mut writer, all_file_systems, verbose) {