mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
fix: add version key to detect specific send/recv logic
This commit is contained in:
@@ -1151,6 +1151,7 @@ impl LoginConfigHandler {
|
||||
my_name: crate::username(),
|
||||
option: self.get_option_message(true).into(),
|
||||
session_id: self.session_id,
|
||||
version: crate::VERSION.to_string(),
|
||||
..Default::default()
|
||||
};
|
||||
if self.is_file_transfer {
|
||||
|
||||
@@ -57,6 +57,7 @@ pub enum FS {
|
||||
id: i32,
|
||||
file_num: i32,
|
||||
files: Vec<(String, u64)>,
|
||||
overwrite_detection: bool,
|
||||
},
|
||||
CancelWrite {
|
||||
id: i32,
|
||||
|
||||
@@ -1377,9 +1377,8 @@ pub mod connection_manager {
|
||||
id,
|
||||
file_num,
|
||||
mut files,
|
||||
overwrite_detection
|
||||
} => {
|
||||
// in mobile, can_enable_override_detection is always true
|
||||
let od = true;
|
||||
WRITE_JOBS.lock().unwrap().push(fs::TransferJob::new_write(
|
||||
id,
|
||||
"".to_string(),
|
||||
@@ -1395,7 +1394,7 @@ pub mod connection_manager {
|
||||
..Default::default()
|
||||
})
|
||||
.collect(),
|
||||
true,
|
||||
overwrite_detection
|
||||
));
|
||||
}
|
||||
ipc::FS::CancelWrite { id } => {
|
||||
|
||||
@@ -1099,8 +1099,9 @@ impl Connection {
|
||||
}
|
||||
Some(file_action::Union::Send(s)) => {
|
||||
let id = s.id;
|
||||
let od =
|
||||
can_enable_overwrite_detection(get_version_number(VERSION));
|
||||
let od = can_enable_overwrite_detection(get_version_number(
|
||||
&self.lr.version,
|
||||
));
|
||||
let path = s.path.clone();
|
||||
match fs::TransferJob::new_read(
|
||||
id,
|
||||
@@ -1123,6 +1124,11 @@ impl Connection {
|
||||
}
|
||||
}
|
||||
Some(file_action::Union::Receive(r)) => {
|
||||
// note: 1.1.10 introduced identical file detection, which breaks original logic of send/recv files
|
||||
// whenever got send/recv request, check peer version to ensure old version of rustdesk
|
||||
let od = can_enable_overwrite_detection(get_version_number(
|
||||
&self.lr.version,
|
||||
));
|
||||
self.send_fs(ipc::FS::NewWrite {
|
||||
path: r.path,
|
||||
id: r.id,
|
||||
@@ -1133,6 +1139,7 @@ impl Connection {
|
||||
.drain(..)
|
||||
.map(|f| (f.name, f.modified_time))
|
||||
.collect(),
|
||||
overwrite_detection: od,
|
||||
});
|
||||
}
|
||||
Some(file_action::Union::RemoveDir(d)) => {
|
||||
|
||||
@@ -160,8 +160,8 @@ impl ConnectionManager {
|
||||
id,
|
||||
file_num,
|
||||
mut files,
|
||||
overwrite_detection
|
||||
} => {
|
||||
let od = can_enable_overwrite_detection(get_version_number(VERSION));
|
||||
// cm has no show_hidden context
|
||||
// dummy remote, show_hidden, is_remote
|
||||
write_jobs.push(fs::TransferJob::new_write(
|
||||
@@ -179,7 +179,7 @@ impl ConnectionManager {
|
||||
..Default::default()
|
||||
})
|
||||
.collect(),
|
||||
od,
|
||||
overwrite_detection,
|
||||
));
|
||||
}
|
||||
ipc::FS::CancelWrite { id } => {
|
||||
|
||||
Reference in New Issue
Block a user