opt: name, imports

This commit is contained in:
Kingtous
2022-04-29 16:47:45 +08:00
parent 265e3c760e
commit 02f214e39a
6 changed files with 11 additions and 24 deletions

View File

@@ -63,7 +63,7 @@ pub enum FS {
id: i32,
file_num: i32,
file_size: u64,
modified_time: u64,
last_modified: u64,
is_upload: bool,
},
}

View File

@@ -955,7 +955,6 @@ impl Connection {
}
}
Some(message::Union::file_action(fa)) => {
log::info!("recv file_action, {:?}", fa);
if self.file_transfer.is_some() {
match fa.union {
Some(file_action::Union::read_dir(rd)) => {
@@ -1051,7 +1050,7 @@ impl Connection {
id: d.id,
file_num: d.file_num,
file_size: d.file_size,
modified_time: d.last_edit_timestamp,
last_modified: d.last_modified,
is_upload: true,
}),
_ => {}

View File

@@ -192,7 +192,7 @@ impl ConnectionManager {
id,
file_num,
file_size,
modified_time,
last_modified,
is_upload,
} => {
if let Some(job) = fs::get_job(id, write_jobs) {
@@ -205,7 +205,7 @@ impl ConnectionManager {
let digest = FileTransferDigest {
id,
file_num,
last_edit_timestamp: modified_time,
last_modified,
file_size,
..Default::default()
};
@@ -222,9 +222,6 @@ impl ConnectionManager {
DigestCheckResult::NeedConfirm(mut digest) => {
// upload to server, but server has the same file, request
digest.is_upload = is_upload;
log::info!(
"server has the same file, send server digest to local"
);
let mut msg_out = Message::new();
let mut fr = FileResponse::new();
fr.set_digest(digest);
@@ -365,6 +362,7 @@ impl ConnectionManager {
}
async fn send(msg: Message, conn: &mut Connection) {
println!("send msg: {:?}", msg);
match msg.write_to_bytes() {
Ok(bytes) => allow_err!(conn.send(&Data::RawMessage(bytes)).await),
err => allow_err!(err),

View File

@@ -768,6 +768,7 @@ impl Handler {
}
fn reconnect(&mut self) {
println!("reconnecting");
let cloned = self.clone();
let mut lock = self.write().unwrap();
lock.thread.take().map(|t| t.join());
@@ -1559,7 +1560,6 @@ impl Remote {
to,
job.files().len()
);
let config = self.handler.lc.read().unwrap().version;
let m = make_fd(job.id(), job.files(), true);
self.handler.call("updateFolderFiles", &make_args!(m));
let files = job.files().clone();