mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-17 18:21:02 +03:00
feat: file transfer, resume (#12626)
Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
@@ -861,6 +861,7 @@ async fn handle_fs(
|
||||
file_size,
|
||||
last_modified,
|
||||
is_upload,
|
||||
is_resume,
|
||||
} => {
|
||||
if let Some(job) = fs::get_job(id, write_jobs) {
|
||||
let mut req = FileTransferSendConfirmRequest {
|
||||
@@ -879,8 +880,9 @@ async fn handle_fs(
|
||||
if let Some(file) = job.files().get(file_num as usize) {
|
||||
if let fs::DataSource::FilePath(p) = &job.data_source {
|
||||
let path = get_string(&fs::TransferJob::join(p, &file.name));
|
||||
match is_write_need_confirmation(&path, &digest) {
|
||||
match is_write_need_confirmation(is_resume, &path, &digest) {
|
||||
Ok(digest_result) => {
|
||||
job.set_digest(file_size, last_modified);
|
||||
match digest_result {
|
||||
DigestCheckResult::IsSame => {
|
||||
req.set_skip(true);
|
||||
@@ -910,6 +912,13 @@ async fn handle_fs(
|
||||
}
|
||||
}
|
||||
}
|
||||
ipc::FS::SendConfirm(bytes) => {
|
||||
if let Ok(r) = FileTransferSendConfirmRequest::parse_from_bytes(&bytes) {
|
||||
if let Some(job) = fs::get_job(r.id, write_jobs) {
|
||||
job.confirm(&r).await;
|
||||
}
|
||||
}
|
||||
}
|
||||
ipc::FS::Rename { id, path, new_name } => {
|
||||
rename_file(path, new_name, id, tx).await;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user