Commit f3ad370f 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.

(cherry picked from commit c5a9722d)
parent 2426b5ba
...@@ -592,13 +592,13 @@ Result SFTPInternal::sftpOpenConnection(const AuthInfo &info) ...@@ -592,13 +592,13 @@ Result SFTPInternal::sftpOpenConnection(const AuthInfo &info)
return Result::fail(KIO::ERR_INTERNAL, i18n("Could not disable Nagle's Algorithm.")); return Result::fail(KIO::ERR_INTERNAL, i18n("Could not disable Nagle's Algorithm."));
} }
// Don't use any compression // Prefer not to use compression
rc = ssh_options_set(mSession, SSH_OPTIONS_COMPRESSION_C_S, "none"); rc = ssh_options_set(mSession, SSH_OPTIONS_COMPRESSION_C_S, "none,zlib@openssh.com,zlib");
if (rc < 0) { if (rc < 0) {
return Result::fail(KIO::ERR_INTERNAL, i18n("Could not set compression.")); 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) { if (rc < 0) {
return Result::fail(KIO::ERR_INTERNAL, i18n("Could not set compression.")); 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