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%2FAsyncSshHandlerWriter.java;h=f35372742e9b3aa7f4c54bc6fe6fd05dbab71be9;hb=4f0f6f3a97b17d1e6914149c4c999d8801596c41;hp=96e54942dfac06cc9d9a779ea8a1f4e0ad5e83c2;hpb=92708e68b817912bd6fd6814805017cc24a9875f;p=netconf.git diff --git a/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/AsyncSshHandlerWriter.java b/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/AsyncSshHandlerWriter.java index 96e54942df..f35372742e 100644 --- a/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/AsyncSshHandlerWriter.java +++ b/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/AsyncSshHandlerWriter.java @@ -12,6 +12,7 @@ import com.google.common.base.Preconditions; import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelPromise; +import java.io.IOException; import java.nio.charset.StandardCharsets; import java.util.Deque; import java.util.LinkedList; @@ -85,7 +86,7 @@ public final class AsyncSshHandlerWriter implements AutoCloseable { if (LOG.isTraceEnabled()) { LOG.trace("Writing request on channel: {}, message: {}", ctx.channel(), byteBufToString(byteBufMsg)); } - asyncIn.write(toBuffer(byteBufMsg)).addListener(future -> { + asyncIn.writePacket(toBuffer(byteBufMsg)).addListener(future -> { // synchronized block due to deadlock that happens on ssh window resize // writes and pending writes would lock the underlyinch channel session // window resize write would try to write the message on an already locked channelSession, @@ -122,8 +123,7 @@ public final class AsyncSshHandlerWriter implements AutoCloseable { writePendingIfAny(); }); - } catch (final WritePendingException e) { - + } catch (final IOException | WritePendingException e) { if (!wasPending) { queueRequest(ctx, byteBufMsg, promise); }