btrbk: force disabling of ssh compression (ssh -o compression=no) if stream_compress is set

pull/106/merge
Axel Burri 2016-08-21 17:36:36 +02:00
parent b49ee61ecd
commit b0feaf4413
1 changed files with 6 additions and 2 deletions

8
btrbk
View File

@ -1726,17 +1726,21 @@ sub vinfo_rsh($;@)
my $ssh_port = config_key($config, "ssh_port");
my $ssh_user = config_key($config, "ssh_user");
my $ssh_identity = config_key($config, "ssh_identity");
my $ssh_compression = $opts{disable_compression} ? undef : config_key($config, "ssh_compression");
my $ssh_compression = config_key($config, "ssh_compression");
my $ssh_cipher_spec = config_key($config, "ssh_cipher_spec") // "default";
my @ssh_options;
push(@ssh_options, '-p', $ssh_port) if($ssh_port ne "default");
push(@ssh_options, '-C') if($ssh_compression);
push(@ssh_options, '-c', $ssh_cipher_spec) if($ssh_cipher_spec ne "default");
if($ssh_identity) {
push(@ssh_options, '-i', $ssh_identity);
} else {
WARN_ONCE "No SSH identity provided (option ssh_identity is not set) for: " . ($vinfo->{CONFIG}->{url} // $vinfo->{PRINT});
}
if($opts{disable_compression}) {
push(@ssh_options, '-o', 'compression=no'); # force ssh compression=no (in case it is defined in ssh_config)
} elsif($ssh_compression) {
push(@ssh_options, '-C');
}
return ['ssh', @ssh_options, $ssh_user . '@' . $host ];
}