From c43dc3364b7db4f4ea1de9128c7cbb76eb1379ba Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Fri, 26 Jan 2018 15:53:33 +0100 Subject: [PATCH] Cleanup Http2MultiplexCodec by removing out-dated TODO Motivation: Http2MultiplexCodec contains some TODO that is outdated. Modifications: Remove TODO which is outdated Result: Cleaner code. --- .../handler/codec/http2/Http2MultiplexCodec.java | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2MultiplexCodec.java b/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2MultiplexCodec.java index 4972a044d5..1310f77d10 100644 --- a/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2MultiplexCodec.java +++ b/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2MultiplexCodec.java @@ -155,9 +155,6 @@ public class Http2MultiplexCodec extends Http2FrameCodec { private final ChannelHandler inboundStreamHandler; private int initialOutboundStreamWindow = Http2CodecUtil.DEFAULT_WINDOW_SIZE; - // TODO: We may be able to optimize when we really need to call flush(...) during channelReadComplete(...) - // by checking if this is true and only then call flush(...). - private boolean flushNeeded; private boolean parentReadInProgress; private int idCount; @@ -376,18 +373,10 @@ public class Http2MultiplexCodec extends Http2FrameCodec { tail = head = null; // We always flush as this is what Http2ConnectionHandler does for now. - // TODO: I think this is not really necessary and we should be able to optimize this in the future by - // checking flushNeeded and only flush if this returns true. flush0(ctx); } } - @Override - public final void flush(ChannelHandlerContext ctx) { - flushNeeded = false; - super.flush(ctx); - } - // Allow to override for testing void flush0(ChannelHandlerContext ctx) { flush(ctx); @@ -768,10 +757,8 @@ public class Http2MultiplexCodec extends Http2FrameCodec { unsafe().recvBufAllocHandle().readComplete(); pipeline().fireChannelReadComplete(); } - flushNeeded |= flushPending; } finally { inFireChannelReadComplete = false; - flushPending = false; } }