@UnstableApi public class DefaultHttp2HeadersDecoder extends Object implements Http2HeadersDecoder, Http2HeadersDecoder.Configuration
Http2HeadersDecoder.Configuration| Constructor and Description |
|---|
DefaultHttp2HeadersDecoder() |
DefaultHttp2HeadersDecoder(boolean validateHeaders) |
DefaultHttp2HeadersDecoder(boolean validateHeaders,
long maxHeaderListSize)
Create a new instance.
|
DefaultHttp2HeadersDecoder(boolean validateHeaders,
long maxHeaderListSize,
int initialHuffmanDecodeCapacity)
Create a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
Http2HeadersDecoder.Configuration |
configuration()
Get the
Http2HeadersDecoder.Configuration for this Http2HeadersDecoder |
Http2Headers |
decodeHeaders(int streamId,
io.netty.buffer.ByteBuf headerBlock)
Decodes the given headers block and returns the headers.
|
long |
maxHeaderListSize()
Represents the value for
SETTINGS_MAX_HEADER_LIST_SIZE.
|
void |
maxHeaderListSize(long max,
long goAwayMax)
Configure the maximum allowed size in bytes of each set of headers.
|
long |
maxHeaderListSizeGoAway()
Represents the upper bound in bytes for a set of headers before a
GO_AWAY should be sent. |
long |
maxHeaderTableSize()
Represents the value for
SETTINGS_HEADER_TABLE_SIZE.
|
void |
maxHeaderTableSize(long max)
Represents the value for
SETTINGS_HEADER_TABLE_SIZE.
|
public DefaultHttp2HeadersDecoder()
public DefaultHttp2HeadersDecoder(boolean validateHeaders)
public DefaultHttp2HeadersDecoder(boolean validateHeaders,
long maxHeaderListSize)
validateHeaders - true to validate headers are valid according to the RFC.maxHeaderListSize - This is the only setting that can be configured before notifying the peer.
This is because SETTINGS_MAX_HEADER_LIST_SIZE
allows a lower than advertised limit from being enforced, and the default limit is unlimited
(which is dangerous).public DefaultHttp2HeadersDecoder(boolean validateHeaders,
long maxHeaderListSize,
int initialHuffmanDecodeCapacity)
validateHeaders - true to validate headers are valid according to the RFC.maxHeaderListSize - This is the only setting that can be configured before notifying the peer.
This is because SETTINGS_MAX_HEADER_LIST_SIZE
allows a lower than advertised limit from being enforced, and the default limit is unlimited
(which is dangerous).initialHuffmanDecodeCapacity - Size of an intermediate buffer used during huffman decode.public void maxHeaderTableSize(long max)
throws Http2Exception
Http2HeadersDecoder.ConfigurationSETTINGS frame.maxHeaderTableSize in interface Http2HeadersDecoder.ConfigurationHttp2Exceptionpublic long maxHeaderTableSize()
Http2HeadersDecoder.ConfigurationHttp2CodecUtil.DEFAULT_HEADER_TABLE_SIZE.maxHeaderTableSize in interface Http2HeadersDecoder.Configurationpublic void maxHeaderListSize(long max,
long goAwayMax)
throws Http2Exception
Http2HeadersDecoder.Configuration
This method should only be called by Netty (not users) as a result of a receiving a SETTINGS frame.
maxHeaderListSize in interface Http2HeadersDecoder.Configurationmax - SETTINGS_MAX_HEADER_LIST_SIZE.
If this limit is exceeded the implementation should attempt to keep the HPACK header tables up to date
by processing data from the peer, but a RST_STREAM frame will be sent for the offending stream.goAwayMax - Must be >= max. A GO_AWAY frame will be generated if this limit is exceeded
for any particular stream.Http2Exception - if limits exceed the RFC's boundaries or max > goAwayMax.public long maxHeaderListSize()
Http2HeadersDecoder.ConfigurationmaxHeaderListSize in interface Http2HeadersDecoder.Configurationpublic long maxHeaderListSizeGoAway()
Http2HeadersDecoder.ConfigurationGO_AWAY should be sent.
This will be <=
SETTINGS_MAX_HEADER_LIST_SIZE.maxHeaderListSizeGoAway in interface Http2HeadersDecoder.Configurationpublic Http2HeadersDecoder.Configuration configuration()
Http2HeadersDecoderHttp2HeadersDecoder.Configuration for this Http2HeadersDecoderconfiguration in interface Http2HeadersDecoderpublic Http2Headers decodeHeaders(int streamId, io.netty.buffer.ByteBuf headerBlock) throws Http2Exception
Http2HeadersDecoderdecodeHeaders in interface Http2HeadersDecoderHttp2ExceptionCopyright © 2008–2017 The Netty Project. All rights reserved.