From: Robert Varga Date: Thu, 12 Oct 2023 20:26:30 +0000 (+0200) Subject: Do not propagate empty writes X-Git-Tag: v7.0.0~452 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=453dcd8f87ee343a02e3ca2b00f3b36ed47a90cf;p=netconf.git Do not propagate empty writes The API contract says we can see 0-sized events. Do not propagate those, as they are not changing channel state. JIRA: NETCONF-1106 Change-Id: I5dab0bca2616627833409eb82da733bec87cc1a4 Signed-off-by: Robert Varga --- diff --git a/protocol/netconf-server/src/main/java/org/opendaylight/netconf/server/NetconfSubsystem.java b/protocol/netconf-server/src/main/java/org/opendaylight/netconf/server/NetconfSubsystem.java index 7571b71300..a94cbe6305 100644 --- a/protocol/netconf-server/src/main/java/org/opendaylight/netconf/server/NetconfSubsystem.java +++ b/protocol/netconf-server/src/main/java/org/opendaylight/netconf/server/NetconfSubsystem.java @@ -89,7 +89,10 @@ final class NetconfSubsystem extends AbstractCommandSupport @Override public int data(final ChannelSession channel, final byte[] buf, final int start, final int len) { - innerChannel.writeInbound(Unpooled.copiedBuffer(buf, start, len)); + // Do not propagate empty invocations + if (len != 0) { + innerChannel.writeInbound(Unpooled.copiedBuffer(buf, start, len)); + } return len; }