Skip to content

An open-source remote desktop application designed for self-hosting, as an alternative to TeamViewer.

fix: file transfer, resume, path and finished size (#12739)

fufesouac70f380a6ef
diff --git a/libs/hbb_common b/libs/hbb_common
index 5b6c0cf49..fa8f28977 160000
--- a/libs/hbb_common
+++ b/libs/hbb_common
@@ -1 +1 @@
-Subproject commit 5b6c0cf49a6773ccca9c9e9bf18ebc8716734873
+Subproject commit fa8f2897762d331c7c6ce3d99a34b8b7701d0c4b
diff --git a/src/client/io_loop.rs b/src/client/io_loop.rs
index 356b10d42..b85e864f3 100644
--- a/src/client/io_loop.rs
+++ b/src/client/io_loop.rs
@@ -722,12 +722,22 @@ impl<T: InvokeUiSession> Remote<T> {
fs::DataSource::FilePath(_p) => {
job.is_last_job = false;
job.is_resume = true;
+ job.set_finished_size_on_resume();
+ #[cfg(not(windows))]
+ let files = job.files().clone();
+ #[cfg(windows)]
+ let mut files = job.files().clone();
+ #[cfg(windows)]
+ if self.handler.peer_platform() != "Windows" {
+ // peer is not windows, need transform \ to /
+ fs::transform_windows_path(&mut files);
+ }
allow_err!(
peer.send(&fs::new_receive(
id,
job.remote.clone(),
job.file_num,
- job.files.clone(),
+ files,
job.total_size(),
))
.await
@@ -1463,6 +1473,7 @@ impl<T: InvokeUiSession> Remote<T> {
if let Some(job) = fs::get_job(fd.id, &mut self.write_jobs) {
log::info!("job set_files: {:?}", entries);
job.set_files(entries);
+ job.set_finished_size_on_resume();
} else if let Some(job) = self.remove_jobs.get_mut(&fd.id) {
job.files = entries;
}