From d549f0b55e08fd9998d0eb1e8950ee73c42d06ec Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Fri, 29 Jul 2022 18:32:03 +0200 Subject: [PATCH] Require maximum chunk size to be specified The default incoming chunk size is controlled by session negotiator, make sure to co-locate the tuneable value there and remove deprecated constructors for both NetconfChunkAggregator and AbstractNetconfSessionNegotiator. Change-Id: Iab489e35e18905c33a747a52c1698ece4e51d3ef Signed-off-by: Robert Varga --- .../AbstractNetconfSessionNegotiator.java | 8 -------- .../nettyutil/handler/NetconfChunkAggregator.java | 15 --------------- 2 files changed, 23 deletions(-) diff --git a/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/AbstractNetconfSessionNegotiator.java b/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/AbstractNetconfSessionNegotiator.java index a644150e67..65d10ffe9c 100644 --- a/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/AbstractNetconfSessionNegotiator.java +++ b/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/AbstractNetconfSessionNegotiator.java @@ -107,14 +107,6 @@ public abstract class AbstractNetconfSessionNegotiator 0, "Invalid maximum incoming chunk size %s", maximumIncomingChunkSize); } - @Deprecated(since = "4.0.1", forRemoval = true) - protected AbstractNetconfSessionNegotiator(final HelloMessage hello, final Promise promise, - final Channel channel, final Timer timer, - final L sessionListener, final long connectionTimeoutMillis) { - this(hello, promise, channel, timer, sessionListener, connectionTimeoutMillis, - DEFAULT_MAXIMUM_INCOMING_CHUNK_SIZE); - } - protected final @NonNull HelloMessage localHello() { return localHello; } diff --git a/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/NetconfChunkAggregator.java b/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/NetconfChunkAggregator.java index 49e6a89dfd..5e91619c5c 100644 --- a/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/NetconfChunkAggregator.java +++ b/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/NetconfChunkAggregator.java @@ -16,7 +16,6 @@ import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.ByteToMessageDecoder; import java.util.List; import org.checkerframework.checker.index.qual.NonNegative; -import org.opendaylight.netconf.nettyutil.AbstractNetconfSessionNegotiator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -27,10 +26,6 @@ public class NetconfChunkAggregator extends ByteToMessageDecoder { private static final String GOT_PARAM_WHILE_WAITING_FOR_PARAM_PARAM_PARAM = "Got byte {} while waiting for {}-{}-{}"; - @Deprecated(since = "4.0.1", forRemoval = true) - public static final @NonNegative int DEFAULT_MAXIMUM_CHUNK_SIZE = - AbstractNetconfSessionNegotiator.DEFAULT_MAXIMUM_INCOMING_CHUNK_SIZE; - private enum State { HEADER_ONE, // \n HEADER_TWO, // # @@ -48,16 +43,6 @@ public class NetconfChunkAggregator extends ByteToMessageDecoder { private long chunkSize; private CompositeByteBuf chunk; - /** - * Construct an instance with maximum chunk size set to {@link #DEFAULT_MAXIMUM_CHUNK_SIZE}. - * - * @deprecated Prefer {@link #NetconfChunkAggregator(int)} for fine-grained control. - */ - @Deprecated(since = "4.0.1", forRemoval = true) - public NetconfChunkAggregator() { - this(DEFAULT_MAXIMUM_CHUNK_SIZE); - } - /** * Construct an instance with specified maximum chunk size. * -- 2.36.6