Http2FrameReader that supports all frame types defined by the HTTP/2 specification.
| Modifier and Type | Class and Description |
|---|---|
| protected class | DefaultHttp2FrameReader.
Utility class to help with construction of the headers block that may potentially span multiple frames. |
| private abstract class | DefaultHttp2FrameReader.
Base class for processing of HEADERS and PUSH_PROMISE header blocks that potentially span multiple frames. |
| Modifier and Type | Field and Description |
|---|---|
| private Http2Flags | |
| private byte | |
| private DefaultHttp2FrameReader. | |
| private final Http2HeadersDecoder | |
| private int | |
| private int | |
| private boolean | readError
Once set to |
| private boolean | readingHeaders
|
| private int |
| Access | Constructor and Description |
|---|---|
| public | |
| public | DefaultHttp2FrameReader(boolean
true to validate headers. false to not validate headers.Create a new instance. |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Implements io. |
| private void | |
| public Http2FrameReader. | configuration()
Implements io. Http2FrameReader
|
| public Http2FrameSizePolicy | frameSizePolicy()
Implements io. Http2FrameSizePolicy for this Http2FrameReader
|
| public Http2HeadersDecoder. | |
| private static int | lengthWithoutTrailingPadding(int readableBytes, int padding)
The padding parameter consists of the 1 byte pad length field and the trailing padding bytes. |
| public void | maxFrameSize(int max)
Implements io. |
| public int | maxFrameSize()
Implements io. |
| private void | |
| private void | |
| private void | |
| private void | readDataFrame(ChannelHandlerContext ctx, ByteBuf payload, int payloadEndIndex, Http2FrameListener listener)
|
| public void | readFrame(ChannelHandlerContext ctx, ByteBuf input, Http2FrameListener listener)
Implements io. |
| private static void | readGoAwayFrame(ChannelHandlerContext ctx, ByteBuf payload, int payloadEndIndex, Http2FrameListener listener)
|
| private void | readHeadersFrame(final ChannelHandlerContext ctx, ByteBuf payload, int payloadEndIndex, Http2FrameListener listener)
|
| private int | |
| private void | |
| private void | |
| private void | readPushPromiseFrame(final ChannelHandlerContext ctx, ByteBuf payload, int payloadEndIndex, Http2FrameListener listener)
|
| private void | |
| private void | |
| private void | readUnknownFrame(ChannelHandlerContext ctx, ByteBuf payload, int payloadEndIndex, Http2FrameListener listener)
|
| private void | |
| private void | |
| private void | |
| private void | |
| private void | |
| private void | |
| private void | |
| private void | |
| private void | |
| private void | |
| private void | |
| private void | |
| private void | |
| private void | |
| private static void | |
| private void | |
| private void |
| flags | back to summary |
|---|---|
| private Http2Flags flags | |
| frameType | back to summary |
|---|---|
| private byte frameType | |
| headersContinuation | back to summary |
|---|---|
| private DefaultHttp2FrameReader. | |
| headersDecoder | back to summary |
|---|---|
| private final Http2HeadersDecoder headersDecoder | |
| maxFrameSize | back to summary |
|---|---|
| private int maxFrameSize | |
| payloadLength | back to summary |
|---|---|
| private int payloadLength | |
| readError | back to summary |
|---|---|
| private boolean readError Once set to | |
| readingHeaders | back to summary |
|---|---|
| private boolean readingHeaders
| |
| streamId | back to summary |
|---|---|
| private int streamId | |
| DefaultHttp2FrameReader | back to summary |
|---|---|
| public DefaultHttp2FrameReader() Create a new instance. Header names will be validated. | |
| DefaultHttp2FrameReader | back to summary |
|---|---|
| public DefaultHttp2FrameReader(boolean validateHeaders) Create a new instance.
| |
| DefaultHttp2FrameReader | back to summary |
|---|---|
| public DefaultHttp2FrameReader(Http2HeadersDecoder headersDecoder) | |
| close | back to summary |
|---|---|
| public void close() Implements io. Doc from io. Closes this reader and frees any allocated resources.
| |
| closeHeadersContinuation | back to summary |
|---|---|
| private void closeHeadersContinuation() | |
| configuration | back to summary |
|---|---|
| public Http2FrameReader. Implements io. Doc from io. Get the configuration related elements for this
| |
| frameSizePolicy | back to summary |
|---|---|
| public Http2FrameSizePolicy frameSizePolicy() Implements io. Doc from io. Get the
| |
| headersConfiguration | back to summary |
|---|---|
| public Http2HeadersDecoder. Implements io. Doc from io. Get the
| |
| lengthWithoutTrailingPadding | back to summary |
|---|---|
| private static int lengthWithoutTrailingPadding(int readableBytes, int padding) The padding parameter consists of the 1 byte pad length field and the trailing padding bytes. This method returns the number of readable bytes without the trailing padding. | |
| maxFrameSize | back to summary |
|---|---|
| public void maxFrameSize(int max) throws Http2Exception Implements io. Doc from io. Sets the maximum allowed frame size. Attempts to write frames longer than this maximum will fail.
This value is used to represent
SETTINGS_MAX_FRAME_SIZE. This method should
only be called by Netty (not users) as a result of a receiving a
| |
| maxFrameSize | back to summary |
|---|---|
| public int maxFrameSize() Implements io. Doc from io. Gets the maximum allowed frame size.
This value is used to represent
SETTINGS_MAX_FRAME_SIZE. The initial value
defined by the RFC is unlimited but enforcing a lower limit is generally permitted.
| |
| processHeaderState | back to summary |
|---|---|
| private void processHeaderState(ByteBuf in) throws Http2Exception | |
| processPayloadState | back to summary |
|---|---|
| private void processPayloadState(ChannelHandlerContext ctx, ByteBuf in, Http2FrameListener listener) throws Http2Exception | |
| readContinuationFrame | back to summary |
|---|---|
| private void readContinuationFrame(ByteBuf payload, int payloadEndIndex, Http2FrameListener listener) throws Http2Exception | |
| readDataFrame | back to summary |
|---|---|
| private void readDataFrame(ChannelHandlerContext ctx, ByteBuf payload, int payloadEndIndex, Http2FrameListener listener) throws Http2Exception | |
| readFrame | back to summary |
|---|---|
| public void readFrame(ChannelHandlerContext ctx, ByteBuf input, Http2FrameListener listener) throws Http2Exception Implements io. Doc from io. Attempts to read the next frame from the input buffer. If enough data is available to fully read the frame, notifies the listener of the read frame.
| |
| readGoAwayFrame | back to summary |
|---|---|
| private static void readGoAwayFrame(ChannelHandlerContext ctx, ByteBuf payload, int payloadEndIndex, Http2FrameListener listener) throws Http2Exception | |
| readHeadersFrame | back to summary |
|---|---|
| private void readHeadersFrame(final ChannelHandlerContext ctx, ByteBuf payload, int payloadEndIndex, Http2FrameListener listener) throws Http2Exception | |
| readPadding | back to summary |
|---|---|
| private int readPadding(ByteBuf payload) If padding is present in the payload, reads the next byte as padding. The padding also includes the one byte width of the pad length field. Otherwise, returns zero. | |
| readPingFrame | back to summary |
|---|---|
| private void readPingFrame(ChannelHandlerContext ctx, long data, Http2FrameListener listener) throws Http2Exception | |
| readPriorityFrame | back to summary |
|---|---|
| private void readPriorityFrame(ChannelHandlerContext ctx, ByteBuf payload, Http2FrameListener listener) throws Http2Exception | |
| readPushPromiseFrame | back to summary |
|---|---|
| private void readPushPromiseFrame(final ChannelHandlerContext ctx, ByteBuf payload, int payloadEndIndex, Http2FrameListener listener) throws Http2Exception | |
| readRstStreamFrame | back to summary |
|---|---|
| private void readRstStreamFrame(ChannelHandlerContext ctx, ByteBuf payload, Http2FrameListener listener) throws Http2Exception | |
| readSettingsFrame | back to summary |
|---|---|
| private void readSettingsFrame(ChannelHandlerContext ctx, ByteBuf payload, Http2FrameListener listener) throws Http2Exception | |
| readUnknownFrame | back to summary |
|---|---|
| private void readUnknownFrame(ChannelHandlerContext ctx, ByteBuf payload, int payloadEndIndex, Http2FrameListener listener) throws Http2Exception | |
| readWindowUpdateFrame | back to summary |
|---|---|
| private void readWindowUpdateFrame(ChannelHandlerContext ctx, ByteBuf payload, Http2FrameListener listener) throws Http2Exception | |
| resetHeadersContinuationIfEnd | back to summary |
|---|---|
| private void resetHeadersContinuationIfEnd(boolean endOfHeaders) | |
| verifyAssociatedWithAStream | back to summary |
|---|---|
| private void verifyAssociatedWithAStream() throws Http2Exception | |
| verifyContinuationFrame | back to summary |
|---|---|
| private void verifyContinuationFrame() throws Http2Exception | |
| verifyDataFrame | back to summary |
|---|---|
| private void verifyDataFrame() throws Http2Exception | |
| verifyGoAwayFrame | back to summary |
|---|---|
| private void verifyGoAwayFrame() throws Http2Exception | |
| verifyHeadersFrame | back to summary |
|---|---|
| private void verifyHeadersFrame() throws Http2Exception | |
| verifyNotProcessingHeaders | back to summary |
|---|---|
| private void verifyNotProcessingHeaders() throws Http2Exception Verify that current state is not processing on header block
| |
| verifyPadding | back to summary |
|---|---|
| private void verifyPadding(int padding) throws Http2Exception | |
| verifyPingFrame | back to summary |
|---|---|
| private void verifyPingFrame() throws Http2Exception | |
| verifyPriorityFrame | back to summary |
|---|---|
| private void verifyPriorityFrame() throws Http2Exception | |
| verifyPushPromiseFrame | back to summary |
|---|---|
| private void verifyPushPromiseFrame() throws Http2Exception | |
| verifyRstStreamFrame | back to summary |
|---|---|
| private void verifyRstStreamFrame() throws Http2Exception | |
| verifySettingsFrame | back to summary |
|---|---|
| private void verifySettingsFrame() throws Http2Exception | |
| verifyStreamOrConnectionId | back to summary |
|---|---|
| private static void verifyStreamOrConnectionId(int streamId, String argumentName) throws Http2Exception | |
| verifyUnknownFrame | back to summary |
|---|---|
| private void verifyUnknownFrame() throws Http2Exception | |
| verifyWindowUpdateFrame | back to summary |
|---|---|
| private void verifyWindowUpdateFrame() throws Http2Exception | |
| Modifier and Type | Field and Description |
|---|---|
| private ByteBuf |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv final void | addFragment(ByteBuf
the fragment of the headers block to be added. fragment, int len, ByteBufAllocator allocator for new blocks if needed. alloc, boolean flag indicating whether the current frame is the end of the headers.
This is used for an optimization for when the first fragment is the full
block. In that case, the buffer is used directly without copying. endOfHeaders)Adds a fragment to the block. |
| pack-priv void | |
| pack-priv Http2Headers | |
| private void |
| headerBlock | back to summary |
|---|---|
| private ByteBuf headerBlock | |
| HeadersBlockBuilder | back to summary |
|---|---|
| protected HeadersBlockBuilder() | |
| addFragment | back to summary |
|---|---|
| pack-priv final void addFragment(ByteBuf fragment, int len, ByteBufAllocator alloc, boolean endOfHeaders) throws Http2Exception Adds a fragment to the block.
| |
| close | back to summary |
|---|---|
| pack-priv void close() Closes this builder and frees any resources. | |
| headers | back to summary |
|---|---|
| pack-priv Http2Headers headers() throws Http2Exception Builds the headers from the completed headers block. After this is called, this builder should not be called again. | |
| headerSizeExceeded | back to summary |
|---|---|
| private void headerSizeExceeded() throws Http2Exception The local header size maximum has been exceeded while accumulating bytes.
| |
Http2FrameListener once the end of headers is reached.
| Modifier and Type | Field and Description |
|---|---|
| private final DefaultHttp2FrameReader. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv final void | |
| pack-priv abstract int | |
| pack-priv final DefaultHttp2FrameReader. | |
| pack-priv abstract void | processFragment(boolean
whether the fragment is the last in the header block. endOfHeaders, ByteBuf the fragment of the header block to be added. fragment, int len, Http2FrameListener the listener to be notified if the header block is completed. listener)Processes the next fragment for the current header block. |
| builder | back to summary |
|---|---|
| private final DefaultHttp2FrameReader. | |
| HeadersContinuation | back to summary |
|---|---|
| private HeadersContinuation() | |
| close | back to summary |
|---|---|
| pack-priv final void close() Free any allocated resources. | |
| getStreamId | back to summary |
|---|---|
| pack-priv abstract int getStreamId() Returns the stream for which headers are currently being processed. | |
| headersBlockBuilder | back to summary |
|---|---|
| pack-priv final DefaultHttp2FrameReader. | |
| processFragment | back to summary |
|---|---|
| pack-priv abstract void processFragment(boolean endOfHeaders, ByteBuf fragment, int len, Http2FrameListener listener) throws Http2Exception Processes the next fragment for the current header block.
| |