add: msg
This commit is contained in:
parent
74a3799b78
commit
83c75409e8
@ -264,6 +264,7 @@ message FileResponse {
|
|||||||
FileTransferError error = 3;
|
FileTransferError error = 3;
|
||||||
FileTransferDone done = 4;
|
FileTransferDone done = 4;
|
||||||
FileTransferDigest digest = 5;
|
FileTransferDigest digest = 5;
|
||||||
|
FileTransferDirOffsetRequest offset = 6;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,6 +59,11 @@ pub enum FS {
|
|||||||
id: i32,
|
id: i32,
|
||||||
file_num: i32,
|
file_num: i32,
|
||||||
},
|
},
|
||||||
|
WriteOffset {
|
||||||
|
id: i32,
|
||||||
|
file_num: i32,
|
||||||
|
offset_blk: u32
|
||||||
|
},
|
||||||
CheckDigest {
|
CheckDigest {
|
||||||
id: i32,
|
id: i32,
|
||||||
file_num: i32,
|
file_num: i32,
|
||||||
|
@ -1053,6 +1053,14 @@ impl Connection {
|
|||||||
last_modified: d.last_modified,
|
last_modified: d.last_modified,
|
||||||
is_upload: true,
|
is_upload: true,
|
||||||
}),
|
}),
|
||||||
|
Some(file_response::Union::offset(offset)) => {
|
||||||
|
// TODO: i32
|
||||||
|
// self.send_fs(ipc::FS::WriteOffset {
|
||||||
|
// id: offset.id,
|
||||||
|
// file_num: offset.file_num,
|
||||||
|
// offset_blk: offset.offset_blk,
|
||||||
|
// });
|
||||||
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
},
|
},
|
||||||
Some(message::Union::misc(misc)) => match misc.union {
|
Some(message::Union::misc(misc)) => match misc.union {
|
||||||
|
@ -1319,7 +1319,7 @@ async fn io_loop(handler: Handler) {
|
|||||||
clipboard_file_context: None,
|
clipboard_file_context: None,
|
||||||
};
|
};
|
||||||
remote.io_loop(&key, &token).await;
|
remote.io_loop(&key, &token).await;
|
||||||
remote.sync_jobs_status_to_local();
|
remote.sync_jobs_status_to_local().await;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct RemoveJob {
|
struct RemoveJob {
|
||||||
@ -1452,7 +1452,7 @@ impl Remote {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self.sync_jobs_status_to_local();
|
self.sync_jobs_status_to_local().await;
|
||||||
log::debug!("Exit io_loop of id={}", self.handler.id);
|
log::debug!("Exit io_loop of id={}", self.handler.id);
|
||||||
}
|
}
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
@ -1798,6 +1798,7 @@ impl Remote {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn sync_jobs_status_to_local(&mut self) -> bool {
|
async fn sync_jobs_status_to_local(&mut self) -> bool {
|
||||||
|
println!("sync job status");
|
||||||
let mut config: PeerConfig = self.handler.load_config();
|
let mut config: PeerConfig = self.handler.load_config();
|
||||||
let mut transfer_metas = TransferSerde::default();
|
let mut transfer_metas = TransferSerde::default();
|
||||||
for job in self.read_jobs.iter() {
|
for job in self.read_jobs.iter() {
|
||||||
@ -1896,6 +1897,10 @@ impl Remote {
|
|||||||
job.files = entries;
|
job.files = entries;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Some(file_response::Union::offset(offset)) => {
|
||||||
|
// TODO: offset
|
||||||
|
// upload
|
||||||
|
}
|
||||||
Some(file_response::Union::digest(digest)) => {
|
Some(file_response::Union::digest(digest)) => {
|
||||||
if digest.is_upload {
|
if digest.is_upload {
|
||||||
if let Some(job) = fs::get_job(digest.id, &mut self.read_jobs) {
|
if let Some(job) = fs::get_job(digest.id, &mut self.read_jobs) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user