mirror of
https://github.com/iterate-ch/cyberduck.git
synced 2026-05-26 19:10:49 +00:00
Merge pull request #18046 from iterate-ch/bugfix/GH-18045
Enable heartbeat
This commit is contained in:
@@ -654,7 +654,7 @@ ssh.authentication.publickey.default.rsa=~/.ssh/id_rsa
|
||||
ssh.authentication.publickey.default.dsa=~/.ssh/id_dsa
|
||||
ssh.authentication.agent.enable=true
|
||||
|
||||
ssh.heartbeat.provider=keep-alive
|
||||
ssh.heartbeat.provider=heartbeat
|
||||
ssh.heartbeat.seconds=60
|
||||
|
||||
# Enable ZLIB compression
|
||||
|
||||
@@ -158,8 +158,6 @@ public class SFTPSession extends Session<SSHClient> {
|
||||
else {
|
||||
connection.connect(new OpenSSHHostnameConfigurator().getHostname(host.getHostname()), host.getPort());
|
||||
}
|
||||
final KeepAlive keepalive = connection.getConnection().getKeepAlive();
|
||||
keepalive.setKeepAliveInterval(preferences.getInteger("ssh.heartbeat.seconds"));
|
||||
return connection;
|
||||
}
|
||||
catch(IOException e) {
|
||||
@@ -169,6 +167,8 @@ public class SFTPSession extends Session<SSHClient> {
|
||||
|
||||
private SSHClient toClient(final HostKeyCallback key, final Config configuration) {
|
||||
final SSHClient connection = new SSHClient(configuration);
|
||||
final KeepAlive keepalive = connection.getConnection().getKeepAlive();
|
||||
keepalive.setKeepAliveInterval(preferences.getInteger("ssh.heartbeat.seconds"));
|
||||
final int timeout = ConnectionTimeoutFactory.get(preferences).getTimeout() * 1000;
|
||||
connection.getTransport().setTimeoutMs(timeout);
|
||||
connection.setTimeout(timeout);
|
||||
|
||||
Reference in New Issue
Block a user