karaf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Baptiste Onofré ...@nanthrax.net>
Subject Re: Upgrade to MINA SSHD 0.14.0 breaks karaf-client SSH client timeout
Date Tue, 05 Jan 2016 06:40:51 GMT
https://issues.apache.org/jira/browse/KARAF-4246

On 01/04/2016 11:46 PM, kotoole wrote:
> Index: src/main/java/org/apache/karaf/client/ClientConfig.java
> ===================================================================
> --- src/main/java/org/apache/karaf/client/ClientConfig.java	(revision 33766)
> +++ src/main/java/org/apache/karaf/client/ClientConfig.java	(revision 33767)
> @@ -38,6 +38,7 @@
>       private int level;
>       private int retryAttempts;
>       private int retryDelay;
> +    private long idleTimeout;
>       private boolean batch;
>       private String file = null;
>       private String keyFile = null;
> @@ -64,6 +65,7 @@
>           level = Integer.parseInt(shellCfg.getProperty("logLevel", "1"));
>           retryAttempts = 0;
>           retryDelay = 2;
> +        idleTimeout =
> Long.parseLong(shellCfg.getProperty("sshIdleTimeout"));
>           batch = false;
>           file = null;
>           user = null;
> @@ -293,4 +295,8 @@
>       public String getKeyFile() {
>           return keyFile;
>       }
> +
> +    public long getIdleTimeout() {
> +      return idleTimeout;
> +    }
>   }
> Index: src/main/java/org/apache/karaf/client/Main.java
> ===================================================================
> --- src/main/java/org/apache/karaf/client/Main.java	(revision 33766)
> +++ src/main/java/org/apache/karaf/client/Main.java	(revision 33767)
> @@ -37,6 +37,7 @@
>   import org.apache.sshd.client.UserInteraction;
>   import org.apache.sshd.client.channel.ChannelShell;
>   import org.apache.sshd.client.future.ConnectFuture;
> +import org.apache.sshd.common.FactoryManager;
>   import org.apache.sshd.common.RuntimeSshException;
>   import org.apache.sshd.common.keyprovider.FileKeyPairProvider;
>   import org.fusesource.jansi.AnsiConsole;
> @@ -78,6 +79,7 @@
>           int exitStatus = 0;
>           try {
>               client = SshClient.setUpDefaultClient();
> +            client.getProperties().put(FactoryManager.IDLE_TIMEOUT,
> String.valueOf(config.getIdleTimeout()));
>               setupAgent(config.getUser(), config.getKeyFile(), client);
>               final Console console = System.console();
>               if (console != null) {
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Mime
View raw message