]>
Commit | Line | Data |
---|---|---|
7c673cae | 1 | // |
92f5a8d4 | 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) |
7c673cae FG |
3 | // |
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) | |
6 | // | |
b32b8144 FG |
7 | // Official repository: https://github.com/boostorg/beast |
8 | // | |
7c673cae FG |
9 | // This is a derivative work based on Zlib, copyright below: |
10 | /* | |
11 | Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler | |
12 | ||
13 | This software is provided 'as-is', without any express or implied | |
14 | warranty. In no event will the authors be held liable for any damages | |
15 | arising from the use of this software. | |
16 | ||
17 | Permission is granted to anyone to use this software for any purpose, | |
18 | including commercial applications, and to alter it and redistribute it | |
19 | freely, subject to the following restrictions: | |
20 | ||
21 | 1. The origin of this software must not be misrepresented; you must not | |
22 | claim that you wrote the original software. If you use this software | |
23 | in a product, an acknowledgment in the product documentation would be | |
24 | appreciated but is not required. | |
25 | 2. Altered source versions must be plainly marked as such, and must not be | |
26 | misrepresented as being the original software. | |
27 | 3. This notice may not be removed or altered from any source distribution. | |
28 | ||
29 | Jean-loup Gailly Mark Adler | |
30 | jloup@gzip.org madler@alumni.caltech.edu | |
31 | ||
32 | The data format used by the zlib library is described by RFCs (Request for | |
33 | Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950 | |
34 | (zlib format), rfc1951 (deflate format) and rfc1952 (gzip format). | |
35 | */ | |
36 | ||
92f5a8d4 TL |
37 | #ifndef BOOST_BEAST_ZLIB_ERROR_HPP |
38 | #define BOOST_BEAST_ZLIB_ERROR_HPP | |
39 | ||
40 | #include <boost/beast/core/detail/config.hpp> | |
41 | #include <boost/beast/core/error.hpp> | |
42 | ||
43 | namespace boost { | |
44 | namespace beast { | |
45 | namespace zlib { | |
46 | ||
47 | /** Error codes returned by the deflate codecs. | |
7c673cae FG |
48 | */ |
49 | enum class error | |
50 | { | |
51 | /** Additional buffers are required. | |
52 | ||
53 | This error indicates that one or both of the buffers | |
54 | provided buffers do not have sufficient available bytes | |
55 | to make forward progress. | |
56 | ||
57 | This does not always indicate a failure condition. | |
58 | ||
59 | @note This is the same as `Z_BUF_ERROR` returned by ZLib. | |
60 | */ | |
61 | need_buffers = 1, | |
62 | ||
63 | /** End of stream reached. | |
64 | ||
65 | @note This is the same as `Z_STREAM_END` returned by ZLib. | |
66 | */ | |
67 | end_of_stream, | |
68 | ||
92f5a8d4 TL |
69 | /** Preset dictionary required |
70 | ||
71 | This error indicates that a preset dictionary was not provided and is now | |
72 | needed at this point. | |
73 | ||
74 | This does not always indicate a failure condition. | |
75 | ||
76 | @note This is the same as `Z_NEED_DICT` returned by ZLib. | |
77 | */ | |
78 | need_dict, | |
79 | ||
7c673cae FG |
80 | /** Invalid stream or parameters. |
81 | ||
82 | This error is returned when invalid parameters are passed, | |
83 | or the operation being performed is not consistent with the | |
84 | state of the stream. For example, attempting to write data | |
85 | when the end of stream is already reached. | |
86 | ||
87 | @note This is the same as `Z_STREAM_ERROR` returned by ZLib. | |
88 | */ | |
89 | stream_error, | |
90 | ||
91 | // | |
92 | // Errors generated by basic_deflate_stream | |
93 | // | |
94 | ||
95 | // | |
96 | // Errors generated by basic_inflate_stream | |
97 | // | |
98 | ||
99 | /// Invalid block type | |
100 | invalid_block_type, | |
101 | ||
102 | /// Invalid stored block length | |
103 | invalid_stored_length, | |
104 | ||
105 | /// Too many length or distance symbols | |
106 | too_many_symbols, | |
107 | ||
108 | /// Invalid code lengths | |
92f5a8d4 TL |
109 | invalid_code_lengths, |
110 | #ifndef BOOST_BEAST_NO_DEPRECATED | |
111 | invalid_code_lenths = invalid_code_lengths, | |
112 | #endif | |
7c673cae FG |
113 | |
114 | /// Invalid bit length repeat | |
115 | invalid_bit_length_repeat, | |
116 | ||
117 | /// Missing end of block code | |
118 | missing_eob, | |
119 | ||
120 | /// Invalid literal/length code | |
121 | invalid_literal_length, | |
122 | ||
123 | /// Invalid distance code | |
124 | invalid_distance_code, | |
125 | ||
126 | /// Invalid distance too far back | |
127 | invalid_distance, | |
128 | ||
129 | // | |
130 | // Errors generated by inflate_table | |
131 | // | |
132 | ||
133 | /// Over-subscribed length code | |
134 | over_subscribed_length, | |
135 | ||
136 | /// Incomplete length set | |
137 | incomplete_length_set, | |
138 | ||
139 | ||
140 | ||
141 | /// general error | |
142 | general | |
143 | }; | |
144 | ||
145 | } // zlib | |
146 | } // beast | |
b32b8144 | 147 | } // boost |
7c673cae | 148 | |
92f5a8d4 TL |
149 | #include <boost/beast/zlib/impl/error.hpp> |
150 | #ifdef BOOST_BEAST_HEADER_ONLY | |
b32b8144 | 151 | #include <boost/beast/zlib/impl/error.ipp> |
92f5a8d4 | 152 | #endif |
7c673cae FG |
153 | |
154 | #endif | |
155 |