X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=netconf%2Fnetconf-netty-util%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fnetconf%2Fnettyutil%2Fhandler%2Fssh%2Fclient%2FAsyncSshHandler.java;h=0d2f6e1aa5aa42868fb6bcec746a87ee168139a9;hb=22755ee880d798830f42cc0d60e84c8602fe3794;hp=f9598210a6ec0a4772d2796958eda212baf64a4f;hpb=6e662cfa5ed236a16ae47e4917fe6f847e0a9598;p=netconf.git diff --git a/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/AsyncSshHandler.java b/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/AsyncSshHandler.java index f9598210a6..0d2f6e1aa5 100644 --- a/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/AsyncSshHandler.java +++ b/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/AsyncSshHandler.java @@ -140,10 +140,10 @@ public class AsyncSshHandler extends ChannelOutboundHandlerAdapter { private synchronized void handleSshAuthenticated(final NettyAwareClientSession newSession, final ChannelHandlerContext ctx) { - try { - LOG.debug("SSH session authenticated on channel: {}, server version: {}", ctx.channel(), - newSession.getServerVersion()); + LOG.debug("SSH session authenticated on channel: {}, server version: {}", ctx.channel(), + newSession.getServerVersion()); + try { channel = newSession.createSubsystemChannel(SUBSYSTEM, ctx); channel.setStreaming(ClientChannel.Streaming.Async); channel.open().addListener(future -> { @@ -153,8 +153,6 @@ public class AsyncSshHandler extends ChannelOutboundHandlerAdapter { handleSshSetupFailure(ctx, future.getException()); } }); - - } catch (final IOException e) { handleSshSetupFailure(ctx, e); } @@ -191,8 +189,8 @@ public class AsyncSshHandler extends ChannelOutboundHandlerAdapter { @Override public synchronized void connect(final ChannelHandlerContext ctx, final SocketAddress remoteAddress, final SocketAddress localAddress, final ChannelPromise promise) throws Exception { - LOG.debug("SSH session connecting on channel {}. promise: {}", ctx.channel(), connectPromise); - connectPromise = promise; + LOG.debug("SSH session connecting on channel {}. promise: {}", ctx.channel(), promise); + connectPromise = requireNonNull(promise); if (negotiationFuture != null) { negotiationFutureListener = future -> {