Implementation Note
This class is security sensitive, and depends on users correctly identifying their headers as security sensitive or not. If a header is considered not sensitive, methods names "insensitive" are used which are fast, but don't provide any security guarantees.
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final byte | |
| private final HpackEncoder. | |
| private final HpackHuffmanEncoder | |
| pack-priv static final int | |
| private final int | |
| private final boolean | |
| private HpackEncoder. | |
| private long | |
| private long | |
| private final HpackEncoder. | |
| private final HpackEncoder. | |
| pack-priv static final int | |
| private long |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv | |
| pack-priv | HpackEncoder(boolean ignoreMaxHeaderListSize, int arraySizeHint, int huffCodeThreshold)
Creates a new encoder. |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| private void | addNameValueEntry(CharSequence name, CharSequence value, int nameHash, int valueHash, int nextCounter)
|
| private int | |
| private void | encodeAndAddEntries(ByteBuf out, CharSequence name, int nameHash, CharSequence value, int valueHash)
|
| private void | encodeHeader(ByteBuf out, CharSequence name, CharSequence value, boolean sensitive, long headerSize)
Encode the header field into the header block. |
| public void | encodeHeaders(int streamId, ByteBuf out, Http2Headers headers, Http2HeadersEncoder.
Encode the header field into the header block. |
| private void | encodeHeadersEnforceMaxHeaderListSize(int streamId, ByteBuf out, Http2Headers headers, Http2HeadersEncoder.
|
| private void | encodeHeadersIgnoreMaxHeaderListSize(ByteBuf out, Http2Headers headers, Http2HeadersEncoder.
|
| private static void | |
| private static void | |
| private void | encodeLiteral(ByteBuf out, CharSequence name, CharSequence value, HpackUtil.
Encode literal header field according to Section 6.2. |
| private void | encodeStringLiteral(ByteBuf out, CharSequence string)
Encode string literal according to Section 5.2. |
| private void | ensureCapacity(long headerSize)
Ensure that the dynamic table has enough room to hold 'headerSize' more bytes. |
| private HpackEncoder. | getEntry(CharSequence name, int nameHash)
Returns the lowest index value for the header field name in the dynamic table. |
| private HpackEncoder. | getEntryInsensitive(CharSequence name, int nameHash, CharSequence value, int valueHash)
Returns the header entry with the lowest index value for the header field. |
| pack-priv HpackHeaderField | |
| private int | getIndex(int counter)
Compute the index into the dynamic table given the counter in the header entry. |
| private int | |
| public long | |
| public long | |
| private int | |
| private static int | |
| private boolean | |
| private int | |
| pack-priv int | |
| private void | |
| private void | |
| private void | |
| public void | |
| public void | |
| pack-priv long |
| hashMask | back to summary |
|---|---|
| private final byte hashMask | |
| head | back to summary |
|---|---|
| private final HpackEncoder. | |
| hpackHuffmanEncoder | back to summary |
|---|---|
| private final HpackHuffmanEncoder hpackHuffmanEncoder | |
| HUFF_CODE_THRESHOLD | back to summary |
|---|---|
| pack-priv static final int HUFF_CODE_THRESHOLD | |
| huffCodeThreshold | back to summary |
|---|---|
| private final int huffCodeThreshold | |
| ignoreMaxHeaderListSize | back to summary |
|---|---|
| private final boolean ignoreMaxHeaderListSize | |
| latest | back to summary |
|---|---|
| private HpackEncoder. | |
| maxHeaderListSize | back to summary |
|---|---|
| private long maxHeaderListSize | |
| maxHeaderTableSize | back to summary |
|---|---|
| private long maxHeaderTableSize | |
| nameEntries | back to summary |
|---|---|
| private final HpackEncoder. | |
| nameValueEntries | back to summary |
|---|---|
| private final HpackEncoder. | |
| NOT_FOUND | back to summary |
|---|---|
| pack-priv static final int NOT_FOUND | |
| size | back to summary |
|---|---|
| private long size | |
| HpackEncoder | back to summary |
|---|---|
| pack-priv HpackEncoder() Creates a new encoder. | |
| HpackEncoder | back to summary |
|---|---|
| pack-priv HpackEncoder(boolean ignoreMaxHeaderListSize) Creates a new encoder. | |
| HpackEncoder | back to summary |
|---|---|
| pack-priv HpackEncoder(boolean ignoreMaxHeaderListSize, int arraySizeHint, int huffCodeThreshold) Creates a new encoder. | |
| addNameEntry | back to summary |
|---|---|
| private void addNameEntry(CharSequence name, int nameHash, int nextCounter) | |
| addNameValueEntry | back to summary |
|---|---|
| private void addNameValueEntry(CharSequence name, CharSequence value, int nameHash, int valueHash, int nextCounter) | |
| bucket | back to summary |
|---|---|
| private int bucket(int h) Returns the bucket of the hash table for the hash code h. | |
| encodeAndAddEntries | back to summary |
|---|---|
| private void encodeAndAddEntries(ByteBuf out, CharSequence name, int nameHash, CharSequence value, int valueHash) | |
| encodeHeader | back to summary |
|---|---|
| private void encodeHeader(ByteBuf out, CharSequence name, CharSequence value, boolean sensitive, long headerSize) Encode the header field into the header block.
The given | |
| encodeHeaders | back to summary |
|---|---|
| public void encodeHeaders(int streamId, ByteBuf out, Http2Headers headers, Http2HeadersEncoder. Encode the header field into the header block.
The given | |
| encodeHeadersEnforceMaxHeaderListSize | back to summary |
|---|---|
| private void encodeHeadersEnforceMaxHeaderListSize(int streamId, ByteBuf out, Http2Headers headers, Http2HeadersEncoder. | |
| encodeHeadersIgnoreMaxHeaderListSize | back to summary |
|---|---|
| private void encodeHeadersIgnoreMaxHeaderListSize(ByteBuf out, Http2Headers headers, Http2HeadersEncoder. | |
| encodeInteger | back to summary |
|---|---|
| private static void encodeInteger(ByteBuf out, int mask, int n, int i) Encode integer according to Section 5.1. | |
| encodeInteger | back to summary |
|---|---|
| private static void encodeInteger(ByteBuf out, int mask, int n, long i) Encode integer according to Section 5.1. | |
| encodeLiteral | back to summary |
|---|---|
| private void encodeLiteral(ByteBuf out, CharSequence name, CharSequence value, HpackUtil. Encode literal header field according to Section 6.2. | |
| encodeStringLiteral | back to summary |
|---|---|
| private void encodeStringLiteral(ByteBuf out, CharSequence string) Encode string literal according to Section 5.2. | |
| ensureCapacity | back to summary |
|---|---|
| private void ensureCapacity(long headerSize) Ensure that the dynamic table has enough room to hold 'headerSize' more bytes. Removes the oldest entry from the dynamic table until sufficient space is available. | |
| getEntry | back to summary |
|---|---|
| private HpackEncoder. Returns the lowest index value for the header field name in the dynamic table. Returns -1 if the header field name is not in the dynamic table. | |
| getEntryInsensitive | back to summary |
|---|---|
| private HpackEncoder. Returns the header entry with the lowest index value for the header field. Returns null if header field is not in the dynamic table. | |
| getHeaderField | back to summary |
|---|---|
| pack-priv HpackHeaderField getHeaderField(int index) Return the header field at the given index. Exposed for testing. | |
| getIndex | back to summary |
|---|---|
| private int getIndex(int counter) Compute the index into the dynamic table given the counter in the header entry. | |
| getIndexPlusOffset | back to summary |
|---|---|
| private int getIndexPlusOffset(int counter) | |
| getMaxHeaderListSize | back to summary |
|---|---|
| public long getMaxHeaderListSize() | |
| getMaxHeaderTableSize | back to summary |
|---|---|
| public long getMaxHeaderTableSize() Return the maximum table size. | |
| getNameIndex | back to summary |
|---|---|
| private int getNameIndex(CharSequence name) | |
| hash | back to summary |
|---|---|
| private static int hash(int nameHash, int valueHash) | |
| isEmpty | back to summary |
|---|---|
| private boolean isEmpty() | |
| latestCounter | back to summary |
|---|---|
| private int latestCounter() | |
| length | back to summary |
|---|---|
| pack-priv int length() Return the number of header fields in the dynamic table. Exposed for testing. | |
| remove | back to summary |
|---|---|
| private void remove() Remove the oldest header field from the dynamic table. | |
| removeNameEntryMatchingCounter | back to summary |
|---|---|
| private void removeNameEntryMatchingCounter(CharSequence name, int counter) | |
| removeNameValueEntry | back to summary |
|---|---|
| private void removeNameValueEntry(HpackEncoder. | |
| setMaxHeaderListSize | back to summary |
|---|---|
| public void setMaxHeaderListSize(long maxHeaderListSize) throws Http2Exception | |
| setMaxHeaderTableSize | back to summary |
|---|---|
| public void setMaxHeaderTableSize(ByteBuf out, long maxHeaderTableSize) throws Http2Exception Set the maximum table size. | |
| size | back to summary |
|---|---|
| pack-priv long size() Return the size of the dynamic table. Exposed for testing. | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv int | |
| pack-priv final int | |
| pack-priv final CharSequence | |
| pack-priv HpackEncoder. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void |
| counter | back to summary |
|---|---|
| pack-priv int counter | |
| hash | back to summary |
|---|---|
| pack-priv final int hash | |
| name | back to summary |
|---|---|
| pack-priv final CharSequence name | |
| next | back to summary |
|---|---|
| pack-priv HpackEncoder. | |
| NameEntry | back to summary |
|---|---|
| pack-priv NameEntry(int hash, CharSequence name, int counter, HpackEncoder. | |
| unlink | back to summary |
|---|---|
| pack-priv void unlink() | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv HpackEncoder. | |
| pack-priv final int | |
| pack-priv final int | |
| pack-priv HpackEncoder. |
| Access | Constructor and Description |
|---|---|
| pack-priv | NameValueEntry(int hash, CharSequence name, CharSequence value, int counter, HpackEncoder.
|
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void |
| after | back to summary |
|---|---|
| pack-priv HpackEncoder. | |
| counter | back to summary |
|---|---|
| pack-priv final int counter | |
| hash | back to summary |
|---|---|
| pack-priv final int hash | |
| next | back to summary |
|---|---|
| pack-priv HpackEncoder. | |
| NameValueEntry | back to summary |
|---|---|
| pack-priv NameValueEntry(int hash, CharSequence name, CharSequence value, int counter, HpackEncoder. | |
| unlink | back to summary |
|---|---|
| pack-priv void unlink() | |