From 3704a64ad255b3322742a7d86bfc92bb83701743 Mon Sep 17 00:00:00 2001 From: fufesou Date: Mon, 11 Aug 2025 21:02:08 +0800 Subject: [PATCH] fix: file transfer, resume Signed-off-by: fufesou --- src/fs.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/fs.rs b/src/fs.rs index 2e7f69a..de972ee 100644 --- a/src/fs.rs +++ b/src/fs.rs @@ -1203,13 +1203,14 @@ pub enum DigestCheckResult { #[inline] pub fn is_write_need_confirmation( + is_support_resume: bool, file_path: &str, digest: &FileTransferDigest, ) -> ResultType { let path = Path::new(file_path); let digest_file = format!("{}.digest", file_path); let download_file = format!("{}.download", file_path); - if Path::new(&digest_file).exists() && Path::new(&download_file).exists() { + if is_support_resume && Path::new(&digest_file).exists() && Path::new(&download_file).exists() { // If the digest file exists, it means the file was transferred before. // We can use the digest file to check whether the file is the same. if let Ok(content) = std::fs::read_to_string(digest_file) {