Commit c5a9722d authored by Fabian Vogt's avatar Fabian Vogt
Browse files

sftp: Allow compression if necessary

Specifying only "none" as compression method causes the exchange to fail if
the server doesn't support "none".

Use the same options as OpenSSH does by default. The Compression=yes/no option
in the config file overrides them if specified.

Setting the options explicitly can be dropped in the future after libssh
adjusts its built-in defaults.
parent a41d3438
......@@ -592,13 +592,13 @@ Result SFTPInternal::sftpOpenConnection(const AuthInfo &info)
return Result::fail(KIO::ERR_INTERNAL, i18n("Could not disable Nagle's Algorithm."));
}
// Don't use any compression
rc = ssh_options_set(mSession, SSH_OPTIONS_COMPRESSION_C_S, "none");
// Prefer not to use compression
rc = ssh_options_set(mSession, SSH_OPTIONS_COMPRESSION_C_S, "none,zlib@openssh.com,zlib");
if (rc < 0) {
return Result::fail(KIO::ERR_INTERNAL, i18n("Could not set compression."));
}
rc = ssh_options_set(mSession, SSH_OPTIONS_COMPRESSION_S_C, "none");
rc = ssh_options_set(mSession, SSH_OPTIONS_COMPRESSION_S_C, "none,zlib@openssh.com,zlib");
if (rc < 0) {
return Result::fail(KIO::ERR_INTERNAL, i18n("Could not set compression."));
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment