mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
add: file_num offset
This commit is contained in:
@@ -1313,7 +1313,7 @@ pub enum Data {
|
||||
Close,
|
||||
Login((String, bool)),
|
||||
Message(Message),
|
||||
SendFiles((i32, String, String, bool, bool)),
|
||||
SendFiles((i32, String, String, i32, bool, bool)),
|
||||
RemoveDirAll((i32, String, bool)),
|
||||
ConfirmDeleteFiles((i32, i32)),
|
||||
SetNoConfirm(i32),
|
||||
|
||||
@@ -44,6 +44,7 @@ pub enum FS {
|
||||
NewWrite {
|
||||
path: String,
|
||||
id: i32,
|
||||
file_num: i32,
|
||||
files: Vec<(String, u64)>,
|
||||
},
|
||||
CancelWrite {
|
||||
|
||||
@@ -974,7 +974,7 @@ impl Connection {
|
||||
let id = s.id;
|
||||
let od =
|
||||
can_enable_overwrite_detection(get_version_number(VERSION));
|
||||
match fs::TransferJob::new_read(id, s.path.clone(), s.include_hidden, od) {
|
||||
match fs::TransferJob::new_read(id, s.path.clone(), s.file_num, s.include_hidden, od) {
|
||||
Err(err) => {
|
||||
self.send(fs::new_error(id, err, 0)).await;
|
||||
}
|
||||
@@ -990,6 +990,7 @@ impl Connection {
|
||||
self.send_fs(ipc::FS::NewWrite {
|
||||
path: r.path,
|
||||
id: r.id,
|
||||
file_num: r.file_num,
|
||||
files: r
|
||||
.files
|
||||
.to_vec()
|
||||
|
||||
@@ -158,14 +158,17 @@ impl ConnectionManager {
|
||||
ipc::FS::NewWrite {
|
||||
path,
|
||||
id,
|
||||
file_num,
|
||||
mut files,
|
||||
} => {
|
||||
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(
|
||||
id,
|
||||
"".to_string(),
|
||||
path,
|
||||
file_num,
|
||||
false,
|
||||
false,
|
||||
files
|
||||
|
||||
@@ -125,7 +125,7 @@ class JobTable: Reactor.Component {
|
||||
include_hidden: show_hidden,
|
||||
is_remote: is_remote });
|
||||
this.job_map[id] = this.jobs[this.jobs.length - 1];
|
||||
handler.send_files(id, path, to, show_hidden, is_remote);
|
||||
handler.send_files(id, path, to, 0, show_hidden, is_remote);
|
||||
var self = this;
|
||||
self.timer(30ms, function() { self.update(); });
|
||||
}
|
||||
@@ -138,7 +138,7 @@ class JobTable: Reactor.Component {
|
||||
this.jobs.push(job);
|
||||
this.job_map[id] = this.jobs[this.jobs.length - 1];
|
||||
jobIdCounter = id + 1;
|
||||
handler.send_files(id, path, to, show_hidden, is_remote);
|
||||
handler.send_files(id, path, to, file_num, show_hidden, is_remote);
|
||||
stdout.println(JSON.stringify(job));
|
||||
}
|
||||
|
||||
|
||||
@@ -204,7 +204,7 @@ impl sciter::EventHandler for Handler {
|
||||
fn confirm_delete_files(i32, i32);
|
||||
fn set_no_confirm(i32);
|
||||
fn cancel_job(i32);
|
||||
fn send_files(i32, String, String, bool, bool);
|
||||
fn send_files(i32, String, String, i32, bool, bool);
|
||||
fn get_platform(bool);
|
||||
fn get_path_sep(bool);
|
||||
fn get_icon_path(i32, String);
|
||||
@@ -1586,16 +1586,16 @@ impl Remote {
|
||||
Data::Message(msg) => {
|
||||
allow_err!(peer.send(&msg).await);
|
||||
}
|
||||
Data::SendFiles((id, path, to, include_hidden, is_remote)) => {
|
||||
Data::SendFiles((id, path, to,file_num, include_hidden, is_remote)) => {
|
||||
log::info!("send files, is remote {}", is_remote);
|
||||
let od = can_enable_overwrite_detection(self.handler.lc.read().unwrap().version);
|
||||
if is_remote {
|
||||
log::debug!("New job {}, write to {} from remote {}", id, to, path);
|
||||
self.write_jobs
|
||||
.push(fs::TransferJob::new_write(id, path.clone(),to,include_hidden, is_remote, Vec::new(), od));
|
||||
allow_err!(peer.send(&fs::new_send(id, path, include_hidden)).await);
|
||||
.push(fs::TransferJob::new_write(id, path.clone(),to,file_num, include_hidden, is_remote, Vec::new(), od));
|
||||
allow_err!(peer.send(&fs::new_send(id, path,file_num, include_hidden)).await);
|
||||
} else {
|
||||
match fs::TransferJob::new_read(id, path.clone(),to.clone(),include_hidden,is_remote, include_hidden, od) {
|
||||
match fs::TransferJob::new_read(id, path.clone(),to.clone(), file_num,include_hidden,is_remote, include_hidden, od) {
|
||||
Err(err) => {
|
||||
self.handle_job_status(id, -1, Some(err.to_string()));
|
||||
}
|
||||
@@ -1612,7 +1612,7 @@ impl Remote {
|
||||
let files = job.files().clone();
|
||||
self.read_jobs.push(job);
|
||||
self.timer = time::interval(MILLI1);
|
||||
allow_err!(peer.send(&fs::new_receive(id, to, files)).await);
|
||||
allow_err!(peer.send(&fs::new_receive(id, to, file_num, files)).await);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user