Merge pull request #1102 from Kingtous/master

fix: android overwrite detection for lower version server
This commit is contained in:
RustDesk 2022-07-29 10:20:30 +08:00 committed by GitHub
commit 7983c93be0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -870,8 +870,7 @@ impl Connection {
allow_err!(peer.send(&msg).await); allow_err!(peer.send(&msg).await);
} }
Data::SendFiles((id, path, to, file_num, include_hidden, is_remote)) => { Data::SendFiles((id, path, to, file_num, include_hidden, is_remote)) => {
// in mobile, can_enable_override_detection is always true let od = can_enable_overwrite_detection(self.session.lc.read().unwrap().version);
let od = true;
if is_remote { if is_remote {
log::debug!("New job {}, write to {} from remote {}", id, to, path); log::debug!("New job {}, write to {} from remote {}", id, to, path);
self.write_jobs.push(fs::TransferJob::new_write( self.write_jobs.push(fs::TransferJob::new_write(
@ -882,7 +881,7 @@ impl Connection {
include_hidden, include_hidden,
is_remote, is_remote,
Vec::new(), Vec::new(),
true, od,
)); ));
allow_err!( allow_err!(
peer.send(&fs::new_send(id, path, file_num, include_hidden)) peer.send(&fs::new_send(id, path, file_num, include_hidden))
@ -896,7 +895,7 @@ impl Connection {
file_num, file_num,
include_hidden, include_hidden,
is_remote, is_remote,
true, od,
) { ) {
Err(err) => { Err(err) => {
self.handle_job_status(id, -1, Some(err.to_string())); self.handle_job_status(id, -1, Some(err.to_string()));