Changed buffer size to 65535

This commit is contained in:
veeso
2022-01-04 15:23:17 +01:00
committed by Christian Visintin
parent ec4daf8e25
commit 53271966da
2 changed files with 6 additions and 2 deletions

View File

@@ -56,6 +56,7 @@ Released on FIXME:
- **Tui-realm migration**:
- migrated application to tui-realm 1.x
- Improved application performance
- Changed the buffer size to **65535** (was 65536) for transfer I/O
- **SSH Config**
- Added `ssh config` parameter in configuration
- It is now possible to specify the ssh configuration file to use

View File

@@ -40,6 +40,9 @@ use std::path::{Path, PathBuf};
use std::time::Instant;
use thiserror::Error;
/// Buffer size for remote I/O
const BUFSIZE: usize = 65535;
/// Describes the reason that caused an error during a file transfer
#[derive(Error, Debug)]
enum TransferErrorReason {
@@ -483,7 +486,7 @@ impl FileTransferActivity {
last_input_event_fetch = Some(Instant::now());
}
// Read till you can
let mut buffer: [u8; 65536] = [0; 65536];
let mut buffer: [u8; BUFSIZE] = [0; BUFSIZE];
let delta: usize = match reader.read(&mut buffer) {
Ok(bytes_read) => {
total_bytes_written += bytes_read;
@@ -888,7 +891,7 @@ impl FileTransferActivity {
last_input_event_fetch = Some(Instant::now());
}
// Read till you can
let mut buffer: [u8; 65536] = [0; 65536];
let mut buffer: [u8; BUFSIZE] = [0; BUFSIZE];
let delta: usize = match reader.read(&mut buffer) {
Ok(bytes_read) => {
total_bytes_written += bytes_read;