quick-wins: ControlMaster, -z alias, --progress, fix write warning

- SSH ControlMaster auto with ControlPath for connection reuse
- -z as alias for -c (compression)
- --progress flag showing transfer rate in send_files
- Fixed unused-result warning on write() in transport_ssh.c
This commit is contained in:
2026-07-16 12:28:16 +02:00
parent 78cc735cff
commit d1a23fc4df
5 changed files with 35 additions and 4 deletions
+1
View File
@@ -22,6 +22,7 @@ Config *config_create(char *version, char *send_directory,
config->use_chunk_serialization = use_chunk_serialization;
config->use_compression = use_compression;
config->use_metadata = use_metadata;
config->show_progress = false;
config->compression_level = compression_level;
config->use_sendfile = use_sendfile;
config->chunk_size = chunk_size > 0 ? chunk_size : DEFAULT_CHUNK_SIZE;
+1
View File
@@ -18,6 +18,7 @@ typedef struct Config {
bool use_compression;
bool use_sendfile;
bool use_metadata;
bool show_progress;
int compression_level;
unsigned long long chunk_size;
TransportType transport;
+5 -3
View File
@@ -91,10 +91,12 @@ Client *client_connect_ssh(char *destination) {
snprintf(ssh_user, sizeof(ssh_user), "%s", r.host);
execlp("ssh", "ssh", "-o", "Compression=no", "-o",
"ControlMaster=no", ssh_user, "fastsync-server", "--stdio",
(char *)NULL);
"ControlMaster=auto", "-o",
"ControlPath=~/.cache/fastsync-%r@%h:%p", ssh_user,
"fastsync-server", "--stdio", (char *)NULL);
perror("exec of ssh failed");
(void)write(exec_pipe[1], "x", 1);
ssize_t wret = write(exec_pipe[1], "x", 1);
(void)wret;
_exit(1);
}