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 <robert.varga@pantheon.tech>
if (!isClosing()) {
// TODO: consider using context's allocator for heap buffer here
ctx.fireChannelRead(Unpooled.copiedBuffer(data, off, (int) len));
+ adjustWindow(len);
}
}
// 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);