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
This commit is contained in:
parent
ed1071d327
commit
f4c635d30b
@ -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.ObjectUtil.checkPositive;
|
||||||
import static io.netty.util.internal.ThrowableUtil.unknownStackTrace;
|
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(
|
private static final Http2Exception DECODE_ULE_128_DECOMPRESSION_EXCEPTION = unknownStackTrace(
|
||||||
connectionError(COMPRESSION_ERROR, "HPACK - decompression failure"), HpackDecoder.class,
|
connectionError(COMPRESSION_ERROR, "HPACK - decompression failure"), HpackDecoder.class,
|
||||||
"decodeULE128(..)");
|
"decodeULE128(..)");
|
||||||
@ -96,7 +96,7 @@ final class HpackDecoder {
|
|||||||
* (which is dangerous).
|
* (which is dangerous).
|
||||||
* @param initialHuffmanDecodeCapacity Size of an intermediate buffer used during huffman decode.
|
* @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);
|
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
|
* 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.
|
* 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.maxHeaderListSize = checkPositive(maxHeaderListSize, "maxHeaderListSize");
|
||||||
this.maxHeaderListSizeGoAway = Http2CodecUtil.calculateMaxHeaderListSizeGoAway(maxHeaderListSize);
|
this.maxHeaderListSizeGoAway = Http2CodecUtil.calculateMaxHeaderListSizeGoAway(maxHeaderListSize);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user