From f4c635d30b23be6ce51866704c178232e98015e7 Mon Sep 17 00:00:00 2001 From: Nathan Mittler Date: Fri, 31 Mar 2017 10:51:01 -0700 Subject: [PATCH] Expose HTTP/2 HpackDecoder (#6589) Motivation: gRPC (and potentially other libraries) has an optimized header processor that requires direct access to the HpackDecoder. Modifications: Make the HpackDecoder and its constructors public. Result: Fixes #6579 --- .../java/io/netty/handler/codec/http2/HpackDecoder.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/codec-http2/src/main/java/io/netty/handler/codec/http2/HpackDecoder.java b/codec-http2/src/main/java/io/netty/handler/codec/http2/HpackDecoder.java index dad2c6fc1d..e4d5c5f0d4 100644 --- a/codec-http2/src/main/java/io/netty/handler/codec/http2/HpackDecoder.java +++ b/codec-http2/src/main/java/io/netty/handler/codec/http2/HpackDecoder.java @@ -49,7 +49,7 @@ import static io.netty.util.AsciiString.EMPTY_STRING; import static io.netty.util.internal.ObjectUtil.checkPositive; import static io.netty.util.internal.ThrowableUtil.unknownStackTrace; -final class HpackDecoder { +public final class HpackDecoder { private static final Http2Exception DECODE_ULE_128_DECOMPRESSION_EXCEPTION = unknownStackTrace( connectionError(COMPRESSION_ERROR, "HPACK - decompression failure"), HpackDecoder.class, "decodeULE128(..)"); @@ -96,7 +96,7 @@ final class HpackDecoder { * (which is dangerous). * @param initialHuffmanDecodeCapacity Size of an intermediate buffer used during huffman decode. */ - HpackDecoder(long maxHeaderListSize, int initialHuffmanDecodeCapacity) { + public HpackDecoder(long maxHeaderListSize, int initialHuffmanDecodeCapacity) { this(maxHeaderListSize, initialHuffmanDecodeCapacity, DEFAULT_HEADER_TABLE_SIZE); } @@ -104,7 +104,7 @@ final class HpackDecoder { * Exposed Used for testing only! Default values used in the initial settings frame are overriden intentionally * for testing but violate the RFC if used outside the scope of testing. */ - HpackDecoder(long maxHeaderListSize, int initialHuffmanDecodeCapacity, int maxHeaderTableSize) { + public HpackDecoder(long maxHeaderListSize, int initialHuffmanDecodeCapacity, int maxHeaderTableSize) { this.maxHeaderListSize = checkPositive(maxHeaderListSize, "maxHeaderListSize"); this.maxHeaderListSizeGoAway = Http2CodecUtil.calculateMaxHeaderListSizeGoAway(maxHeaderListSize);