| 1 |
|
|
1 |
|
|
| 2 |
|
// Copyright (c) 2024 Mohammad Nejati
|
2 |
|
// Copyright (c) 2024 Mohammad Nejati
|
| 3 |
|
|
3 |
|
|
| 4 |
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
4 |
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
| 5 |
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
5 |
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
| 6 |
|
|
6 |
|
|
| 7 |
|
// Official repository: https://github.com/cppalliance/http
|
7 |
|
// Official repository: https://github.com/cppalliance/http
|
| 8 |
|
|
8 |
|
|
| 9 |
|
|
9 |
|
|
| 10 |
|
#include <boost/http/brotli/error.hpp>
|
10 |
|
#include <boost/http/brotli/error.hpp>
|
| 11 |
|
|
11 |
|
|
| 12 |
|
|
12 |
|
|
| 13 |
|
|
13 |
|
|
| 14 |
|
|
14 |
|
|
| 15 |
|
|
15 |
|
|
| 16 |
|
|
16 |
|
|
| 17 |
|
|
17 |
|
|
| 18 |
|
|
18 |
|
|
| 19 |
|
|
19 |
|
|
| 20 |
|
|
20 |
|
|
| 21 |
|
return "boost.http.brotli";
|
21 |
|
return "boost.http.brotli";
|
| 22 |
|
|
22 |
|
|
| 23 |
|
|
23 |
|
|
| 24 |
|
|
24 |
|
|
| 25 |
|
|
25 |
|
|
| 26 |
|
failed(int ev) const noexcept
|
26 |
|
failed(int ev) const noexcept
|
| 27 |
|
|
27 |
|
|
| 28 |
|
|
28 |
|
|
| 29 |
|
|
29 |
|
|
| 30 |
|
|
30 |
|
|
| 31 |
|
|
31 |
|
|
| 32 |
|
|
32 |
|
|
| 33 |
|
|
33 |
|
|
| 34 |
|
|
34 |
|
|
| 35 |
|
return message(ev, nullptr, 0);
|
35 |
|
return message(ev, nullptr, 0);
|
| 36 |
|
|
36 |
|
|
| 37 |
|
|
37 |
|
|
| 38 |
|
|
38 |
|
|
| 39 |
|
|
39 |
|
|
| 40 |
|
|
40 |
|
|
| 41 |
|
|
41 |
|
|
| 42 |
|
|
42 |
|
|
| 43 |
|
std::size_t) const noexcept
|
43 |
|
std::size_t) const noexcept
|
| 44 |
|
|
44 |
|
|
| 45 |
|
switch(static_cast<error>(ev))
|
45 |
|
switch(static_cast<error>(ev))
|
| 46 |
|
|
46 |
|
|
| 47 |
|
|
47 |
|
|
| 48 |
|
case error::no_error: return "no_error";
|
48 |
|
case error::no_error: return "no_error";
|
| 49 |
|
case error::success: return "success";
|
49 |
|
case error::success: return "success";
|
| 50 |
|
case error::needs_more_input: return "needs_more_input";
|
50 |
|
case error::needs_more_input: return "needs_more_input";
|
| 51 |
|
case error::needs_more_output: return "needs_more_output";
|
51 |
|
case error::needs_more_output: return "needs_more_output";
|
| 52 |
|
case error::format_exuberant_nibble: return "format_exuberant_nibble";
|
52 |
|
case error::format_exuberant_nibble: return "format_exuberant_nibble";
|
| 53 |
|
case error::format_reserved: return "format_reserved";
|
53 |
|
case error::format_reserved: return "format_reserved";
|
| 54 |
|
case error::format_exuberant_meta_nibbl: return "format_exuberant_meta_nibbl";
|
54 |
|
case error::format_exuberant_meta_nibbl: return "format_exuberant_meta_nibbl";
|
| 55 |
|
case error::format_simple_huffman_alphabet: return "format_simple_huffman_alphabet";
|
55 |
|
case error::format_simple_huffman_alphabet: return "format_simple_huffman_alphabet";
|
| 56 |
|
case error::format_simple_huffman_same: return "format_simple_huffman_same";
|
56 |
|
case error::format_simple_huffman_same: return "format_simple_huffman_same";
|
| 57 |
|
case error::format_cl_space: return "format_cl_space";
|
57 |
|
case error::format_cl_space: return "format_cl_space";
|
| 58 |
|
case error::format_huffman_space: return "format_huffman_space";
|
58 |
|
case error::format_huffman_space: return "format_huffman_space";
|
| 59 |
|
case error::format_context_map_repea: return "format_context_map_repea";
|
59 |
|
case error::format_context_map_repea: return "format_context_map_repea";
|
| 60 |
|
case error::format_block_length_1: return "format_block_length_1";
|
60 |
|
case error::format_block_length_1: return "format_block_length_1";
|
| 61 |
|
case error::format_block_length_2: return "format_block_length_2";
|
61 |
|
case error::format_block_length_2: return "format_block_length_2";
|
| 62 |
|
case error::format_transform: return "format_transform";
|
62 |
|
case error::format_transform: return "format_transform";
|
| 63 |
|
case error::format_dictionary: return "format_dictionary";
|
63 |
|
case error::format_dictionary: return "format_dictionary";
|
| 64 |
|
case error::format_window_bits: return "format_window_bits";
|
64 |
|
case error::format_window_bits: return "format_window_bits";
|
| 65 |
|
case error::format_padding_1: return "format_padding_1";
|
65 |
|
case error::format_padding_1: return "format_padding_1";
|
| 66 |
|
case error::format_padding_2: return "format_padding_2";
|
66 |
|
case error::format_padding_2: return "format_padding_2";
|
| 67 |
|
case error::format_distance: return "format_distance";
|
67 |
|
case error::format_distance: return "format_distance";
|
| 68 |
|
case error::compound_dictionary: return "compound_dictionary";
|
68 |
|
case error::compound_dictionary: return "compound_dictionary";
|
| 69 |
|
case error::dictionary_not_set: return "dictionary_not_set";
|
69 |
|
case error::dictionary_not_set: return "dictionary_not_set";
|
| 70 |
|
case error::invalid_arguments: return "invalid_arguments";
|
70 |
|
case error::invalid_arguments: return "invalid_arguments";
|
| 71 |
|
case error::alloc_context_modes: return "alloc_context_modes";
|
71 |
|
case error::alloc_context_modes: return "alloc_context_modes";
|
| 72 |
|
case error::alloc_tree_groups: return "alloc_tree_groups";
|
72 |
|
case error::alloc_tree_groups: return "alloc_tree_groups";
|
| 73 |
|
case error::alloc_context_map: return "alloc_context_map";
|
73 |
|
case error::alloc_context_map: return "alloc_context_map";
|
| 74 |
|
case error::alloc_ring_buffer_1: return "alloc_ring_buffer_1";
|
74 |
|
case error::alloc_ring_buffer_1: return "alloc_ring_buffer_1";
|
| 75 |
|
case error::alloc_ring_buffer_2: return "alloc_ring_buffer_2";
|
75 |
|
case error::alloc_ring_buffer_2: return "alloc_ring_buffer_2";
|
| 76 |
|
case error::alloc_block_type_trees: return "alloc_block_type_trees";
|
76 |
|
case error::alloc_block_type_trees: return "alloc_block_type_trees";
|
| 77 |
|
case error::unreachable: return "unreachable";
|
77 |
|
case error::unreachable: return "unreachable";
|
| 78 |
|
|
78 |
|
|
| 79 |
|
|
79 |
|
|
| 80 |
|
|
80 |
|
|
| 81 |
|
|
81 |
|
|
| 82 |
|
|
82 |
|
|
| 83 |
|
// msvc 14.0 has a bug that warns about inability
|
83 |
|
// msvc 14.0 has a bug that warns about inability
|
| 84 |
|
// to use constexpr construction here, even though
|
84 |
|
// to use constexpr construction here, even though
|
| 85 |
|
// there's no constexpr construction
|
85 |
|
// there's no constexpr construction
|
| 86 |
|
#if defined(_MSC_VER) && _MSC_VER <= 1900
|
86 |
|
#if defined(_MSC_VER) && _MSC_VER <= 1900
|
| 87 |
|
|
87 |
|
|
| 88 |
|
# pragma warning( disable : 4592 )
|
88 |
|
# pragma warning( disable : 4592 )
|
| 89 |
|
|
89 |
|
|
| 90 |
|
|
90 |
|
|
| 91 |
|
#if defined(__cpp_constinit) && __cpp_constinit >= 201907L
|
91 |
|
#if defined(__cpp_constinit) && __cpp_constinit >= 201907L
|
| 92 |
|
constinit error_cat_type error_cat;
|
92 |
|
constinit error_cat_type error_cat;
|
| 93 |
|
|
93 |
|
|
| 94 |
|
error_cat_type error_cat;
|
94 |
|
error_cat_type error_cat;
|
| 95 |
|
|
95 |
|
|
| 96 |
|
|
96 |
|
|
| 97 |
|
#if defined(_MSC_VER) && _MSC_VER <= 1900
|
97 |
|
#if defined(_MSC_VER) && _MSC_VER <= 1900
|
| 98 |
|
|
98 |
|
|
| 99 |
|
|
99 |
|
|
| 100 |
|
|
100 |
|
|
| 101 |
|
|
101 |
|
|
| 102 |
|
|
102 |
|
|
| 103 |
|
|
103 |
|
|
| 104 |
|
|
104 |
|
|