Break on recv/send errors

This commit is contained in:
ChristianVisintin
2020-12-10 11:51:49 +01:00
parent 66f17c93c2
commit 843c5ab6d0
2 changed files with 8 additions and 1 deletions

View File

@@ -21,8 +21,10 @@ Work in progress
- Removed `CTRL`; just use keys now. - Removed `CTRL`; just use keys now.
- bugfix: - bugfix:
- prevent panic in set_progress, for progress values `> 100.0 or < 0.0` - prevent panic in set_progress, for progress values `> 100.0 or < 0.0`
- Fixed FTP get, which didn't finalize the reader
- dependencies: - dependencies:
- updated `textwrap` to `0.13.0` - updated `textwrap` to `0.13.0`
- updated `ftp4` to `4.0.1`
## 0.1.0 ## 0.1.0

View File

@@ -171,7 +171,9 @@ impl FileTransferActivity {
while buf_start < bytes_read { while buf_start < bytes_read {
// Write bytes // Write bytes
match rhnd.write(&buffer[buf_start..bytes_read]) { match rhnd.write(&buffer[buf_start..bytes_read]) {
Ok(bytes) => buf_start += bytes, Ok(bytes) => {
buf_start += bytes;
}
Err(err) => { Err(err) => {
self.log( self.log(
LogLevel::Error, LogLevel::Error,
@@ -204,6 +206,7 @@ impl FileTransferActivity {
Color::Red, Color::Red,
format!("Could not read local file: {}", err), format!("Could not read local file: {}", err),
)); ));
break
} }
} }
// Increase progress // Increase progress
@@ -441,6 +444,7 @@ impl FileTransferActivity {
err err
), ),
)); ));
break
} }
} }
} }
@@ -456,6 +460,7 @@ impl FileTransferActivity {
Color::Red, Color::Red,
format!("Could not read remote file: {}", err), format!("Could not read remote file: {}", err),
)); ));
break
} }
} }
// Set progress // Set progress