From 65f621ffc65f5905bd94692927ca8e4fede5efff Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Thu, 14 May 2020 23:09:03 +0200 Subject: [PATCH 1/1] Adjust window on read As a side-effect of us bypassing the read function, we no longer update the window occupancy, which leads to the other side stopping sending data. Make sure we adjust the window after passing the data down the pipeline. JIRA: NETCONF-686 Change-Id: I66c4873d901f7b88aabd97a1c599be64397b16c7 Signed-off-by: Robert Varga --- .../handler/ssh/client/NettyAwareChannelSubsystem.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/NettyAwareChannelSubsystem.java b/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/NettyAwareChannelSubsystem.java index 5df448b0a8..035bbdcba0 100644 --- a/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/NettyAwareChannelSubsystem.java +++ b/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/client/NettyAwareChannelSubsystem.java @@ -37,6 +37,7 @@ public class NettyAwareChannelSubsystem extends ChannelSubsystem { if (!isClosing()) { // TODO: consider using context's allocator for heap buffer here ctx.fireChannelRead(Unpooled.copiedBuffer(data, off, (int) len)); + adjustWindow(len); } } @@ -45,9 +46,14 @@ public class NettyAwareChannelSubsystem extends ChannelSubsystem { // If we're already closing, ignore incoming data if (!isClosing()) { LOG.debug("Discarding {} bytes of extended data", len); + adjustWindow(len); } } + private void adjustWindow(final long len) throws IOException { + getLocalWindow().consumeAndCheck(len); + } + @Override public void close() { this.close(false); -- 2.36.6