• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2020 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef QUICHE_HTTP2_HPACK_DECODER_HPACK_DECODING_ERROR_H_
6 #define QUICHE_HTTP2_HPACK_DECODER_HPACK_DECODING_ERROR_H_
7 
8 #include "absl/strings/string_view.h"
9 #include "quiche/common/platform/api/quiche_export.h"
10 
11 namespace http2 {
12 
13 enum class HpackDecodingError {
14   // No error detected so far.
15   kOk,
16   // Varint beyond implementation limit.
17   kIndexVarintError,
18   kNameLengthVarintError,
19   kValueLengthVarintError,
20   // String literal length exceeds buffer limit.
21   kNameTooLong,
22   kValueTooLong,
23   // Error in Huffman encoding.
24   kNameHuffmanError,
25   kValueHuffmanError,
26   // Next instruction should have been a dynamic table size update.
27   kMissingDynamicTableSizeUpdate,
28   // Invalid index in indexed header field representation.
29   kInvalidIndex,
30   // Invalid index in literal header field with indexed name representation.
31   kInvalidNameIndex,
32   // Dynamic table size update not allowed.
33   kDynamicTableSizeUpdateNotAllowed,
34   // Initial dynamic table size update is above low water mark.
35   kInitialDynamicTableSizeUpdateIsAboveLowWaterMark,
36   // Dynamic table size update is above acknowledged setting.
37   kDynamicTableSizeUpdateIsAboveAcknowledgedSetting,
38   // HPACK block ends in the middle of an instruction.
39   kTruncatedBlock,
40   // Incoming data fragment exceeds buffer limit.
41   kFragmentTooLong,
42   // Total compressed HPACK data size exceeds limit.
43   kCompressedHeaderSizeExceedsLimit,
44 };
45 
46 QUICHE_EXPORT absl::string_view HpackDecodingErrorToString(
47     HpackDecodingError error);
48 
49 }  // namespace http2
50 
51 #endif  // QUICHE_HTTP2_HPACK_DECODER_HPACK_DECODING_ERROR_H_
52