@UnstableApi public class DefaultHttp2HeadersDecoder extends java.lang.Object implements Http2HeadersDecoder, Http2HeadersDecoder.Configuration
Http2HeadersDecoder.Configuration| Constructor and Description |
|---|
DefaultHttp2HeadersDecoder() |
DefaultHttp2HeadersDecoder(boolean validateHeaders) |
DefaultHttp2HeadersDecoder(boolean validateHeaders, long maxHeaderListSize)
创建一个新的实例。
|
DefaultHttp2HeadersDecoder(boolean validateHeaders, long maxHeaderListSize, int initialHuffmanDecodeCapacity)
创建一个新的实例。
|
| Modifier and Type | Method and Description |
|---|---|
Http2HeadersDecoder.Configuration |
configuration()
|
Http2Headers |
decodeHeaders(int streamId, ByteBuf headerBlock)
解码给定的标题块并返回标题。
|
long |
maxHeaderListSize()
|
void |
maxHeaderListSize(long max, long goAwayMax)
配置每组标题的最大允许大小(以字节为单位)。
|
long |
maxHeaderListSizeGoAway()
表示在应发送
GO_AWAY之前的一组标头的上限字节数。
|
long |
maxHeaderTableSize()
|
void |
maxHeaderTableSize(long max)
|
protected Http2Headers |
newHeaders()
创建一个新的 Http2Headers对象,该对象将存储解码操作的结果。
|
protected int |
numberOfHeadersGuess()
加权移动平均估计解码过程期间预计有多少头部。
|
protected boolean |
validateHeaders()
确定是否应根据解码操作验证头文件。
|
public DefaultHttp2HeadersDecoder()
public DefaultHttp2HeadersDecoder(boolean validateHeaders)
public DefaultHttp2HeadersDecoder(boolean validateHeaders,
long maxHeaderListSize)
validateHeaders -
true验证标头根据RFC有效。
maxHeaderListSize - 这是在通知对等方之前可以配置的唯一设置。
这是因为SETTINGS_MAX_HEADER_LIST_SIZE允许执行低于广告的限制,并且默认限制是无限的(这是危险的)。
public DefaultHttp2HeadersDecoder(boolean validateHeaders,
long maxHeaderListSize,
int initialHuffmanDecodeCapacity)
validateHeaders -
true验证标头根据RFC有效。
maxHeaderListSize - 这是在通知对等方之前可以配置的唯一设置。
这是因为SETTINGS_MAX_HEADER_LIST_SIZE允许执行低于广告的限制,并且默认限制是无限的(这是危险的)。
initialHuffmanDecodeCapacity - huffman解码过程中使用的中间缓冲区的大小。
public void maxHeaderTableSize(long max)
throws Http2Exception
Http2HeadersDecoder.Configuration
SETTINGS帧的结果来SETTINGS 。
maxHeaderTableSize在界面
Http2HeadersDecoder.Configuration
Http2Exception
public long maxHeaderTableSize()
Http2HeadersDecoder.Configuration
Http2CodecUtil.DEFAULT_HEADER_TABLE_SIZE 。
maxHeaderTableSize在界面
Http2HeadersDecoder.Configuration
public void maxHeaderListSize(long max,
long goAwayMax)
throws Http2Exception
Http2HeadersDecoder.Configuration
这种方法只能由Netty(不是用户)作为接收SETTINGS帧的结果来SETTINGS 。
maxHeaderListSize在界面
Http2HeadersDecoder.Configuration
max - SETTINGS_MAX_HEADER_LIST_SIZE 。
如果超过此限制,则实施应尝试通过处理来自对等方的数据来保持HPACK标题表的最新状态,但会发送RST_STREAM帧用于违规流。
goAwayMax - 必须是>= max 。
如果超过了任何特定流的限制,则会生成GO_AWAY帧。
Http2Exception - 如果限制超过RFC的边界或
max > goAwayMax 。
public long maxHeaderListSize()
Http2HeadersDecoder.Configuration
maxHeaderListSize ,界面
Http2HeadersDecoder.Configuration
public long maxHeaderListSizeGoAway()
GO_AWAY之前的一组标头的上限字节数。
这将是<= SETTINGS_MAX_HEADER_LIST_SIZE 。
maxHeaderListSizeGoAway在界面
Http2HeadersDecoder.Configuration
public Http2HeadersDecoder.Configuration configuration()
Http2HeadersDecoder
configuration在界面
Http2HeadersDecoder
public Http2Headers decodeHeaders(int streamId, ByteBuf headerBlock) throws Http2Exception
Http2HeadersDecoder复制的描述
decodeHeaders在界面
Http2HeadersDecoder
Http2Exception
protected final int numberOfHeadersGuess()
protected final boolean validateHeaders()
true如果首部应作为解码操作的结果进行验证。
protected Http2Headers newHeaders()
Http2Headers对象,该对象将存储解码操作的结果。
Http2Headers对象,它将存储解码操作的结果。
Copyright © 2008–2018 The Netty Project. All rights reserved.