mirror of
https://github.com/veeso/termscp.git
synced 2025-12-07 09:36:00 -08:00
on_sent and on_recv methods for file transfer to finalize streams
This commit is contained in:
@@ -41,7 +41,14 @@ impl FileTransferActivity {
|
||||
Ok(welcome) => {
|
||||
if let Some(banner) = welcome {
|
||||
// Log welcome
|
||||
self.log(LogLevel::Info, format!("Established connection with '{}': \"{}\"", self.params.address, banner).as_ref());
|
||||
self.log(
|
||||
LogLevel::Info,
|
||||
format!(
|
||||
"Established connection with '{}': \"{}\"",
|
||||
self.params.address, banner
|
||||
)
|
||||
.as_ref(),
|
||||
);
|
||||
}
|
||||
// Set state to explorer
|
||||
self.input_mode = InputMode::Explorer;
|
||||
@@ -174,6 +181,14 @@ impl FileTransferActivity {
|
||||
last_progress_val = self.transfer_progress;
|
||||
}
|
||||
}
|
||||
// Finalize stream
|
||||
if let Err(err) = self.client.on_sent(rhnd) {
|
||||
self.log(
|
||||
LogLevel::Warn,
|
||||
format!("Could not finalize remote stream: \"{}\"", err)
|
||||
.as_str(),
|
||||
);
|
||||
}
|
||||
self.log(
|
||||
LogLevel::Info,
|
||||
format!(
|
||||
@@ -352,6 +367,14 @@ impl FileTransferActivity {
|
||||
last_progress_val = self.transfer_progress;
|
||||
}
|
||||
}
|
||||
// Finalize stream
|
||||
if let Err(err) = self.client.on_recv(rhnd) {
|
||||
self.log(
|
||||
LogLevel::Warn,
|
||||
format!("Could not finalize remote stream: \"{}\"", err)
|
||||
.as_str(),
|
||||
);
|
||||
}
|
||||
// Log
|
||||
self.log(
|
||||
LogLevel::Info,
|
||||
|
||||
Reference in New Issue
Block a user