Merge pull request #321 from fufesou/fix/file_transfer_resume

fix: file transfer, resume
This commit is contained in:
RustDesk 2025-08-11 23:17:56 +08:00 committed by GitHub
commit bb2d6fa6bd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1203,13 +1203,14 @@ pub enum DigestCheckResult {
#[inline]
pub fn is_write_need_confirmation(
is_support_resume: bool,
file_path: &str,
digest: &FileTransferDigest,
) -> ResultType<DigestCheckResult> {
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) {