From b0feaf441347a9843c8ea407592d7b0c6115a17e Mon Sep 17 00:00:00 2001 From: Axel Burri Date: Sun, 21 Aug 2016 17:36:36 +0200 Subject: [PATCH] btrbk: force disabling of ssh compression (ssh -o compression=no) if stream_compress is set --- btrbk | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/btrbk b/btrbk index 8b0df23..77d48c1 100755 --- a/btrbk +++ b/btrbk @@ -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 ]; }