summaryrefslogtreecommitdiff
path: root/deps/nghttp2/lib/nghttp2_hd_huffman.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/nghttp2/lib/nghttp2_hd_huffman.h')
-rw-r--r--deps/nghttp2/lib/nghttp2_hd_huffman.h29
1 files changed, 12 insertions, 17 deletions
diff --git a/deps/nghttp2/lib/nghttp2_hd_huffman.h b/deps/nghttp2/lib/nghttp2_hd_huffman.h
index c6e3942e95..2bfd531816 100644
--- a/deps/nghttp2/lib/nghttp2_hd_huffman.h
+++ b/deps/nghttp2/lib/nghttp2_hd_huffman.h
@@ -34,21 +34,20 @@
typedef enum {
/* FSA accepts this state as the end of huffman encoding
sequence. */
- NGHTTP2_HUFF_ACCEPTED = 1,
+ NGHTTP2_HUFF_ACCEPTED = 1 << 14,
/* This state emits symbol */
- NGHTTP2_HUFF_SYM = (1 << 1),
- /* If state machine reaches this state, decoding fails. */
- NGHTTP2_HUFF_FAIL = (1 << 2)
+ NGHTTP2_HUFF_SYM = 1 << 15,
} nghttp2_huff_decode_flag;
typedef struct {
- /* huffman decoding state, which is actually the node ID of internal
- huffman tree. We have 257 leaf nodes, but they are identical to
- root node other than emitting a symbol, so we have 256 internal
- nodes [1..255], inclusive. */
- uint8_t state;
- /* bitwise OR of zero or more of the nghttp2_huff_decode_flag */
- uint8_t flags;
+ /* fstate is the current huffman decoding state, which is actually
+ the node ID of internal huffman tree with
+ nghttp2_huff_decode_flag OR-ed. We have 257 leaf nodes, but they
+ are identical to root node other than emitting a symbol, so we
+ have 256 internal nodes [1..255], inclusive. The node ID 256 is
+ a special node and it is a terminal state that means decoding
+ failed. */
+ uint16_t fstate;
/* symbol if NGHTTP2_HUFF_SYM flag set */
uint8_t sym;
} nghttp2_huff_decode;
@@ -56,12 +55,8 @@ typedef struct {
typedef nghttp2_huff_decode huff_decode_table_type[16];
typedef struct {
- /* Current huffman decoding state. We stripped leaf nodes, so the
- value range is [0..255], inclusive. */
- uint8_t state;
- /* nonzero if we can say that the decoding process succeeds at this
- state */
- uint8_t accept;
+ /* fstate is the current huffman decoding state. */
+ uint16_t fstate;
} nghttp2_hd_huff_decode_context;
typedef struct {