diff --git a/benchmarks/src/jmh/java/io/grpc/netty/InboundHeadersBenchmark.java b/benchmarks/src/jmh/java/io/grpc/netty/InboundHeadersBenchmark.java
index 66c0accd01..007787b2b5 100644
--- a/benchmarks/src/jmh/java/io/grpc/netty/InboundHeadersBenchmark.java
+++ b/benchmarks/src/jmh/java/io/grpc/netty/InboundHeadersBenchmark.java
@@ -35,8 +35,8 @@ import static io.grpc.netty.Utils.CONTENT_TYPE_HEADER;
import static io.grpc.netty.Utils.TE_TRAILERS;
import static io.netty.util.AsciiString.of;
-import io.grpc.netty.GrpcHttp2HeadersDecoder.GrpcHttp2RequestHeaders;
-import io.grpc.netty.GrpcHttp2HeadersDecoder.GrpcHttp2ResponseHeaders;
+import io.grpc.netty.GrpcHttp2HeadersUtils.GrpcHttp2RequestHeaders;
+import io.grpc.netty.GrpcHttp2HeadersUtils.GrpcHttp2ResponseHeaders;
import io.netty.handler.codec.http2.DefaultHttp2Headers;
import io.netty.handler.codec.http2.Http2Headers;
import io.netty.util.AsciiString;
diff --git a/build.gradle b/build.gradle
index 93ac118169..54a4c94b4e 100644
--- a/build.gradle
+++ b/build.gradle
@@ -86,6 +86,7 @@ subprojects {
protocPluginBaseName = 'protoc-gen-grpc-java'
javaPluginPath = "$rootDir/compiler/build/exe/java_plugin/$protocPluginBaseName$exeSuffix"
+ nettyVersion = '4.1.11.Final'
guavaVersion = '19.0'
protobufVersion = '3.2.0'
protobufNanoVersion = '3.0.0-alpha-5'
@@ -191,10 +192,10 @@ subprojects {
protobuf_plugin: 'com.google.protobuf:protobuf-gradle-plugin:0.8.0',
protobuf_util: "com.google.protobuf:protobuf-java-util:${protobufVersion}",
- netty: 'io.netty:netty-codec-http2:[4.1.8.Final]',
- netty_epoll: 'io.netty:netty-transport-native-epoll:4.1.8.Final' + epoll_suffix,
- netty_proxy_handler: 'io.netty:netty-handler-proxy:4.1.8.Final',
- netty_tcnative: 'io.netty:netty-tcnative-boringssl-static:1.1.33.Fork26',
+ netty: "io.netty:netty-codec-http2:[${nettyVersion}]",
+ netty_epoll: "io.netty:netty-transport-native-epoll:${nettyVersion}" + epoll_suffix,
+ netty_proxy_handler: "io.netty:netty-handler-proxy:${nettyVersion}",
+ netty_tcnative: 'io.netty:netty-tcnative-boringssl-static:2.0.1.Final',
// Test dependencies.
junit: 'junit:junit:4.11',
diff --git a/netty/src/main/java/io/grpc/netty/GrpcHttp2HeadersDecoder.java b/netty/src/main/java/io/grpc/netty/GrpcHttp2HeadersUtils.java
similarity index 85%
rename from netty/src/main/java/io/grpc/netty/GrpcHttp2HeadersDecoder.java
rename to netty/src/main/java/io/grpc/netty/GrpcHttp2HeadersUtils.java
index e3183d1e74..ec07bd8266 100644
--- a/netty/src/main/java/io/grpc/netty/GrpcHttp2HeadersDecoder.java
+++ b/netty/src/main/java/io/grpc/netty/GrpcHttp2HeadersUtils.java
@@ -55,12 +55,8 @@ import static io.netty.util.AsciiString.isUpperCase;
import com.google.common.io.BaseEncoding;
import io.grpc.Metadata;
-import io.netty.buffer.ByteBuf;
import io.netty.handler.codec.http2.DefaultHttp2HeadersDecoder;
-import io.netty.handler.codec.http2.Http2Exception;
import io.netty.handler.codec.http2.Http2Headers;
-import io.netty.handler.codec.http2.Http2HeadersDecoder;
-import io.netty.handler.codec.http2.internal.hpack.Decoder;
import io.netty.util.AsciiString;
import io.netty.util.internal.PlatformDependent;
import java.util.ArrayList;
@@ -68,88 +64,30 @@ import java.util.Collections;
import java.util.List;
/**
- * A {@link Http2HeadersDecoder} that allows to use custom {@link Http2Headers} implementations.
- *
- *
Some of the code is copied from Netty's {@link DefaultHttp2HeadersDecoder}.
+ * A headers utils providing custom gRPC implementations of {@link DefaultHttp2HeadersDecoder}.
*/
-abstract class GrpcHttp2HeadersDecoder implements Http2HeadersDecoder,
- Http2HeadersDecoder.Configuration {
-
- private static final float HEADERS_COUNT_WEIGHT_NEW = 1 / 5f;
- private static final float HEADERS_COUNT_WEIGHT_HISTORICAL = 1 - HEADERS_COUNT_WEIGHT_NEW;
-
- private final Decoder decoder;
- private float numHeadersGuess = 8;
-
- GrpcHttp2HeadersDecoder(long maxHeaderListSize) {
- decoder = new Decoder(maxHeaderListSize, 32 /* same as default */);
- }
-
- @Override
- public Http2Headers decodeHeaders(int streamId, ByteBuf headerBlock) throws Http2Exception {
- GrpcHttp2InboundHeaders headers = newHeaders(1 + (int) numHeadersGuess);
- decoder.decode(streamId, headerBlock, headers);
-
- numHeadersGuess = HEADERS_COUNT_WEIGHT_NEW * headers.numHeaders()
- + HEADERS_COUNT_WEIGHT_HISTORICAL * numHeadersGuess;
-
- return headers;
- }
-
- abstract GrpcHttp2InboundHeaders newHeaders(int numHeadersGuess);
-
- @Override
- public Configuration configuration() {
- return this;
- }
-
- @Override
- public long maxHeaderListSize() {
- return decoder.getMaxHeaderListSize();
- }
-
- @Override
- public void maxHeaderListSize(long maxHeaderListSize, long maxHeaderListSizeGoAway)
- throws Http2Exception {
- decoder.setMaxHeaderListSize(maxHeaderListSize, maxHeaderListSizeGoAway);
- }
-
- @Override
- public long maxHeaderListSizeGoAway() {
- return decoder.getMaxHeaderListSizeGoAway();
- }
-
- @Override
- public long maxHeaderTableSize() {
- return decoder.getMaxHeaderTableSize();
- }
-
- @Override
- public void maxHeaderTableSize(long max) throws Http2Exception {
- decoder.setMaxHeaderTableSize(max);
- }
-
- static final class GrpcHttp2ServerHeadersDecoder extends GrpcHttp2HeadersDecoder {
+class GrpcHttp2HeadersUtils {
+ static final class GrpcHttp2ServerHeadersDecoder extends DefaultHttp2HeadersDecoder {
GrpcHttp2ServerHeadersDecoder(long maxHeaderListSize) {
- super(maxHeaderListSize);
+ super(true, maxHeaderListSize);
}
@Override
- GrpcHttp2InboundHeaders newHeaders(int numHeadersGuess) {
- return new GrpcHttp2RequestHeaders(numHeadersGuess);
+ protected GrpcHttp2InboundHeaders newHeaders() {
+ return new GrpcHttp2RequestHeaders(numberOfHeadersGuess());
}
}
- static final class GrpcHttp2ClientHeadersDecoder extends GrpcHttp2HeadersDecoder {
+ static final class GrpcHttp2ClientHeadersDecoder extends DefaultHttp2HeadersDecoder {
GrpcHttp2ClientHeadersDecoder(long maxHeaderListSize) {
- super(maxHeaderListSize);
+ super(true, maxHeaderListSize);
}
@Override
- GrpcHttp2InboundHeaders newHeaders(int numHeadersGuess) {
- return new GrpcHttp2ResponseHeaders(numHeadersGuess);
+ protected GrpcHttp2InboundHeaders newHeaders() {
+ return new GrpcHttp2ResponseHeaders(numberOfHeadersGuess());
}
}
diff --git a/netty/src/main/java/io/grpc/netty/NettyClientHandler.java b/netty/src/main/java/io/grpc/netty/NettyClientHandler.java
index 9b3487c78f..d41daecd54 100644
--- a/netty/src/main/java/io/grpc/netty/NettyClientHandler.java
+++ b/netty/src/main/java/io/grpc/netty/NettyClientHandler.java
@@ -46,7 +46,7 @@ import io.grpc.internal.ClientTransport.PingCallback;
import io.grpc.internal.GrpcUtil;
import io.grpc.internal.Http2Ping;
import io.grpc.internal.KeepAliveManager;
-import io.grpc.netty.GrpcHttp2HeadersDecoder.GrpcHttp2ClientHeadersDecoder;
+import io.grpc.netty.GrpcHttp2HeadersUtils.GrpcHttp2ClientHeadersDecoder;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufUtil;
import io.netty.buffer.Unpooled;
@@ -56,6 +56,7 @@ import io.netty.channel.ChannelFutureListener;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelPromise;
import io.netty.handler.codec.http2.DefaultHttp2Connection;
+import io.netty.handler.codec.http2.DefaultHttp2ConnectionDecoder;
import io.netty.handler.codec.http2.DefaultHttp2ConnectionEncoder;
import io.netty.handler.codec.http2.DefaultHttp2FrameReader;
import io.netty.handler.codec.http2.DefaultHttp2FrameWriter;
@@ -149,8 +150,7 @@ class NettyClientHandler extends AbstractNettyHandler {
connection.local().flowController(
new DefaultHttp2LocalFlowController(connection, DEFAULT_WINDOW_UPDATE_RATIO, true));
- // TODO(ejona): swap back to DefaultHttp2Connection with Netty-4.1.9
- Http2ConnectionDecoder decoder = new FixedHttp2ConnectionDecoder(connection, encoder,
+ Http2ConnectionDecoder decoder = new DefaultHttp2ConnectionDecoder(connection, encoder,
frameReader);
Http2Settings settings = new Http2Settings();
diff --git a/netty/src/main/java/io/grpc/netty/NettyServerHandler.java b/netty/src/main/java/io/grpc/netty/NettyServerHandler.java
index 14aa8c1be1..4cb787dee5 100644
--- a/netty/src/main/java/io/grpc/netty/NettyServerHandler.java
+++ b/netty/src/main/java/io/grpc/netty/NettyServerHandler.java
@@ -55,7 +55,7 @@ import io.grpc.internal.KeepAliveManager;
import io.grpc.internal.LogExceptionRunnable;
import io.grpc.internal.ServerTransportListener;
import io.grpc.internal.StatsTraceContext;
-import io.grpc.netty.GrpcHttp2HeadersDecoder.GrpcHttp2ServerHeadersDecoder;
+import io.grpc.netty.GrpcHttp2HeadersUtils.GrpcHttp2ServerHeadersDecoder;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufUtil;
import io.netty.channel.ChannelFuture;
@@ -64,6 +64,7 @@ import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelPromise;
import io.netty.handler.codec.http2.DecoratingHttp2FrameWriter;
import io.netty.handler.codec.http2.DefaultHttp2Connection;
+import io.netty.handler.codec.http2.DefaultHttp2ConnectionDecoder;
import io.netty.handler.codec.http2.DefaultHttp2ConnectionEncoder;
import io.netty.handler.codec.http2.DefaultHttp2FrameReader;
import io.netty.handler.codec.http2.DefaultHttp2FrameWriter;
@@ -188,8 +189,7 @@ class NettyServerHandler extends AbstractNettyHandler {
frameWriter = new WriteMonitoringFrameWriter(frameWriter, keepAliveEnforcer);
Http2ConnectionEncoder encoder = new DefaultHttp2ConnectionEncoder(connection, frameWriter);
- // TODO(ejona): swap back to DefaultHttp2Connection with Netty-4.1.9
- Http2ConnectionDecoder decoder = new FixedHttp2ConnectionDecoder(connection, encoder,
+ Http2ConnectionDecoder decoder = new DefaultHttp2ConnectionDecoder(connection, encoder,
frameReader);
Http2Settings settings = new Http2Settings();
diff --git a/netty/src/main/java/io/grpc/netty/Utils.java b/netty/src/main/java/io/grpc/netty/Utils.java
index bc30e2a252..b4a7358915 100644
--- a/netty/src/main/java/io/grpc/netty/Utils.java
+++ b/netty/src/main/java/io/grpc/netty/Utils.java
@@ -44,7 +44,7 @@ import io.grpc.Metadata;
import io.grpc.Status;
import io.grpc.internal.GrpcUtil;
import io.grpc.internal.SharedResourceHolder.Resource;
-import io.grpc.netty.GrpcHttp2HeadersDecoder.GrpcHttp2InboundHeaders;
+import io.grpc.netty.GrpcHttp2HeadersUtils.GrpcHttp2InboundHeaders;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.handler.codec.http2.Http2Exception;
diff --git a/netty/src/test/java/io/grpc/netty/GrpcHttp2HeadersDecoderTest.java b/netty/src/test/java/io/grpc/netty/GrpcHttp2HeadersUtilsTest.java
similarity index 96%
rename from netty/src/test/java/io/grpc/netty/GrpcHttp2HeadersDecoderTest.java
rename to netty/src/test/java/io/grpc/netty/GrpcHttp2HeadersUtilsTest.java
index 72304c6b92..7935dc73b5 100644
--- a/netty/src/test/java/io/grpc/netty/GrpcHttp2HeadersDecoderTest.java
+++ b/netty/src/test/java/io/grpc/netty/GrpcHttp2HeadersUtilsTest.java
@@ -37,8 +37,8 @@ import static org.hamcrest.CoreMatchers.containsString;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
-import io.grpc.netty.GrpcHttp2HeadersDecoder.GrpcHttp2ClientHeadersDecoder;
-import io.grpc.netty.GrpcHttp2HeadersDecoder.GrpcHttp2ServerHeadersDecoder;
+import io.grpc.netty.GrpcHttp2HeadersUtils.GrpcHttp2ClientHeadersDecoder;
+import io.grpc.netty.GrpcHttp2HeadersUtils.GrpcHttp2ServerHeadersDecoder;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.handler.codec.http2.DefaultHttp2Headers;
@@ -54,10 +54,10 @@ import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
/**
- * Tests for {@link GrpcHttp2HeadersDecoder}.
+ * Tests for {@link GrpcHttp2HeadersUtils}.
*/
@RunWith(JUnit4.class)
-public class GrpcHttp2HeadersDecoderTest {
+public class GrpcHttp2HeadersUtilsTest {
private static final SensitivityDetector NEVER_SENSITIVE = new SensitivityDetector() {
@Override
diff --git a/netty/src/test/java/io/grpc/netty/GrpcHttp2InboundHeadersTest.java b/netty/src/test/java/io/grpc/netty/GrpcHttp2InboundHeadersTest.java
index 971c23a935..b60b74e4c0 100644
--- a/netty/src/test/java/io/grpc/netty/GrpcHttp2InboundHeadersTest.java
+++ b/netty/src/test/java/io/grpc/netty/GrpcHttp2InboundHeadersTest.java
@@ -37,9 +37,9 @@ import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import com.google.common.io.BaseEncoding;
-import io.grpc.netty.GrpcHttp2HeadersDecoder.GrpcHttp2InboundHeaders;
-import io.grpc.netty.GrpcHttp2HeadersDecoder.GrpcHttp2RequestHeaders;
-import io.grpc.netty.GrpcHttp2HeadersDecoder.GrpcHttp2ResponseHeaders;
+import io.grpc.netty.GrpcHttp2HeadersUtils.GrpcHttp2InboundHeaders;
+import io.grpc.netty.GrpcHttp2HeadersUtils.GrpcHttp2RequestHeaders;
+import io.grpc.netty.GrpcHttp2HeadersUtils.GrpcHttp2ResponseHeaders;
import io.netty.handler.codec.http2.Http2Headers;
import io.netty.util.AsciiString;
import java.util.Random;
diff --git a/netty/src/test/java/io/grpc/netty/NettyClientHandlerTest.java b/netty/src/test/java/io/grpc/netty/NettyClientHandlerTest.java
index d2d160a1b3..94aa60a876 100644
--- a/netty/src/test/java/io/grpc/netty/NettyClientHandlerTest.java
+++ b/netty/src/test/java/io/grpc/netty/NettyClientHandlerTest.java
@@ -70,7 +70,7 @@ import io.grpc.internal.ClientTransport.PingCallback;
import io.grpc.internal.GrpcUtil;
import io.grpc.internal.KeepAliveManager;
import io.grpc.internal.StatsTraceContext;
-import io.grpc.netty.GrpcHttp2HeadersDecoder.GrpcHttp2ClientHeadersDecoder;
+import io.grpc.netty.GrpcHttp2HeadersUtils.GrpcHttp2ClientHeadersDecoder;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufUtil;
import io.netty.buffer.Unpooled;
diff --git a/netty/src/test/java/io/grpc/netty/NettyHandlerTestBase.java b/netty/src/test/java/io/grpc/netty/NettyHandlerTestBase.java
index 6161c4a58b..0b8126e69e 100644
--- a/netty/src/test/java/io/grpc/netty/NettyHandlerTestBase.java
+++ b/netty/src/test/java/io/grpc/netty/NettyHandlerTestBase.java
@@ -62,6 +62,7 @@ import io.netty.handler.codec.http2.Http2Exception;
import io.netty.handler.codec.http2.Http2FrameReader;
import io.netty.handler.codec.http2.Http2FrameWriter;
import io.netty.handler.codec.http2.Http2Headers;
+import io.netty.handler.codec.http2.Http2HeadersDecoder;
import io.netty.handler.codec.http2.Http2LocalFlowController;
import io.netty.handler.codec.http2.Http2Settings;
import io.netty.handler.codec.http2.Http2Stream;
@@ -101,7 +102,7 @@ public abstract class NettyHandlerTestBase {
/**
* Must be called by subclasses to initialize the handler and channel.
*/
- protected final void initChannel(GrpcHttp2HeadersDecoder headersDecoder) throws Exception {
+ protected final void initChannel(Http2HeadersDecoder headersDecoder) throws Exception {
content = Unpooled.copiedBuffer("hello world", UTF_8);
frameWriter = spy(new DefaultHttp2FrameWriter());
frameReader = new DefaultHttp2FrameReader(headersDecoder);
diff --git a/netty/src/test/java/io/grpc/netty/NettyServerHandlerTest.java b/netty/src/test/java/io/grpc/netty/NettyServerHandlerTest.java
index be36c4bc13..2ddc394a5d 100644
--- a/netty/src/test/java/io/grpc/netty/NettyServerHandlerTest.java
+++ b/netty/src/test/java/io/grpc/netty/NettyServerHandlerTest.java
@@ -79,7 +79,7 @@ import io.grpc.internal.ServerStream;
import io.grpc.internal.ServerStreamListener;
import io.grpc.internal.ServerTransportListener;
import io.grpc.internal.StatsTraceContext;
-import io.grpc.netty.GrpcHttp2HeadersDecoder.GrpcHttp2ServerHeadersDecoder;
+import io.grpc.netty.GrpcHttp2HeadersUtils.GrpcHttp2ServerHeadersDecoder;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufUtil;
import io.netty.buffer.Unpooled;
diff --git a/netty/third_party/netty/java/io/grpc/netty/FixedHttp2ConnectionDecoder.java b/netty/third_party/netty/java/io/grpc/netty/FixedHttp2ConnectionDecoder.java
deleted file mode 100644
index fb50245edf..0000000000
--- a/netty/third_party/netty/java/io/grpc/netty/FixedHttp2ConnectionDecoder.java
+++ /dev/null
@@ -1,711 +0,0 @@
-/*
- * Copyright 2014 The Netty Project
- *
- * The Netty Project licenses this file to you under the Apache License, version 2.0 (the
- * "License"); you may not use this file except in compliance with the License. You may obtain a
- * copy of the License at:
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing permissions and limitations under
- * the License.
- */
-package io.grpc.netty;
-
-import io.netty.buffer.ByteBuf;
-import io.netty.channel.ChannelHandlerContext;
-import io.netty.handler.codec.http2.*;
-import io.netty.handler.codec.http2.Http2Connection.Endpoint;
-import io.netty.handler.codec.http2.Http2Exception.ClosedStreamCreationException;
-import io.netty.util.internal.UnstableApi;
-import io.netty.util.internal.logging.InternalLogger;
-import io.netty.util.internal.logging.InternalLoggerFactory;
-
-import java.util.List;
-
-import static io.netty.handler.codec.http2.Http2CodecUtil.DEFAULT_PRIORITY_WEIGHT;
-import static io.netty.handler.codec.http2.Http2CodecUtil.SMALLEST_MAX_CONCURRENT_STREAMS;
-import static io.netty.handler.codec.http2.Http2Error.INTERNAL_ERROR;
-import static io.netty.handler.codec.http2.Http2Error.PROTOCOL_ERROR;
-import static io.netty.handler.codec.http2.Http2Error.STREAM_CLOSED;
-import static io.netty.handler.codec.http2.Http2Exception.connectionError;
-import static io.netty.handler.codec.http2.Http2Exception.streamError;
-import static io.netty.handler.codec.http2.Http2PromisedRequestVerifier.ALWAYS_VERIFY;
-import static io.netty.handler.codec.http2.Http2Stream.State.CLOSED;
-import static io.netty.handler.codec.http2.Http2Stream.State.HALF_CLOSED_REMOTE;
-import static io.netty.util.internal.ObjectUtil.checkNotNull;
-import static java.lang.Integer.MAX_VALUE;
-import static java.lang.Math.min;
-
-/**
- * Provides the default implementation for processing inbound frame events and delegates to a
- * {@link Http2FrameListener}
- *
- * This class will read HTTP/2 frames and delegate the events to a {@link Http2FrameListener}
- *
- * This interface enforces inbound flow control functionality through
- * {@link Http2LocalFlowController}
- */
-@UnstableApi
-class FixedHttp2ConnectionDecoder implements Http2ConnectionDecoder {
- private static final InternalLogger logger = InternalLoggerFactory.getInstance(FixedHttp2ConnectionDecoder.class);
- private Http2FrameListener internalFrameListener = new PrefaceFrameListener();
- private final Http2Connection connection;
- private Http2LifecycleManager lifecycleManager;
- private final Http2ConnectionEncoder encoder;
- private final Http2FrameReader frameReader;
- private Http2FrameListener listener;
- private final Http2PromisedRequestVerifier requestVerifier;
-
- public FixedHttp2ConnectionDecoder(Http2Connection connection,
- Http2ConnectionEncoder encoder,
- Http2FrameReader frameReader) {
- this(connection, encoder, frameReader, ALWAYS_VERIFY);
- }
-
- public FixedHttp2ConnectionDecoder(Http2Connection connection,
- Http2ConnectionEncoder encoder,
- Http2FrameReader frameReader,
- Http2PromisedRequestVerifier requestVerifier) {
- this.connection = checkNotNull(connection, "connection");
- this.frameReader = checkNotNull(frameReader, "frameReader");
- this.encoder = checkNotNull(encoder, "encoder");
- this.requestVerifier = checkNotNull(requestVerifier, "requestVerifier");
- if (connection.local().flowController() == null) {
- connection.local().flowController(new DefaultHttp2LocalFlowController(connection));
- }
- connection.local().flowController().frameWriter(encoder.frameWriter());
- }
-
- @Override
- public void lifecycleManager(Http2LifecycleManager lifecycleManager) {
- this.lifecycleManager = checkNotNull(lifecycleManager, "lifecycleManager");
- }
-
- @Override
- public Http2Connection connection() {
- return connection;
- }
-
- @Override
- public final Http2LocalFlowController flowController() {
- return connection.local().flowController();
- }
-
- @Override
- public void frameListener(Http2FrameListener listener) {
- this.listener = checkNotNull(listener, "listener");
- }
-
- @Override
- public Http2FrameListener frameListener() {
- return listener;
- }
-
- // Visible for testing
- Http2FrameListener internalFrameListener() {
- return internalFrameListener;
- }
-
- @Override
- public boolean prefaceReceived() {
- return FrameReadListener.class == internalFrameListener.getClass();
- }
-
- @Override
- public void decodeFrame(ChannelHandlerContext ctx, ByteBuf in, List