| 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/zlib/error.hpp>
|
10 |
|
#include <boost/http/zlib/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.zlib";
|
21 |
|
return "boost.http.zlib";
|
| 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 |
|
case error::ok: return "Z_OK";
|
47 |
|
case error::ok: return "Z_OK";
|
| 48 |
|
case error::stream_end: return "Z_STREAM_END";
|
48 |
|
case error::stream_end: return "Z_STREAM_END";
|
| 49 |
|
case error::need_dict: return "Z_NEED_DICT";
|
49 |
|
case error::need_dict: return "Z_NEED_DICT";
|
| 50 |
|
case error::errno_: return "Z_ERRNO";
|
50 |
|
case error::errno_: return "Z_ERRNO";
|
| 51 |
|
case error::stream_err: return "Z_STREAM_ERROR";
|
51 |
|
case error::stream_err: return "Z_STREAM_ERROR";
|
| 52 |
|
case error::data_err: return "Z_DATA_ERROR";
|
52 |
|
case error::data_err: return "Z_DATA_ERROR";
|
| 53 |
|
case error::mem_err: return "Z_MEM_ERROR";
|
53 |
|
case error::mem_err: return "Z_MEM_ERROR";
|
| 54 |
|
case error::buf_err: return "Z_BUF_ERROR";
|
54 |
|
case error::buf_err: return "Z_BUF_ERROR";
|
| 55 |
|
case error::version_err: return "Z_VERSION_ERROR";
|
55 |
|
case error::version_err: return "Z_VERSION_ERROR";
|
| 56 |
|
|
56 |
|
|
| 57 |
|
|
57 |
|
|
| 58 |
|
|
58 |
|
|
| 59 |
|
|
59 |
|
|
| 60 |
|
|
60 |
|
|
| 61 |
|
// msvc 14.0 has a bug that warns about inability
|
61 |
|
// msvc 14.0 has a bug that warns about inability
|
| 62 |
|
// to use constexpr construction here, even though
|
62 |
|
// to use constexpr construction here, even though
|
| 63 |
|
// there's no constexpr construction
|
63 |
|
// there's no constexpr construction
|
| 64 |
|
#if defined(_MSC_VER) && _MSC_VER <= 1900
|
64 |
|
#if defined(_MSC_VER) && _MSC_VER <= 1900
|
| 65 |
|
|
65 |
|
|
| 66 |
|
# pragma warning( disable : 4592 )
|
66 |
|
# pragma warning( disable : 4592 )
|
| 67 |
|
|
67 |
|
|
| 68 |
|
|
68 |
|
|
| 69 |
|
#if defined(__cpp_constinit) && __cpp_constinit >= 201907L
|
69 |
|
#if defined(__cpp_constinit) && __cpp_constinit >= 201907L
|
| 70 |
|
constinit error_cat_type error_cat;
|
70 |
|
constinit error_cat_type error_cat;
|
| 71 |
|
|
71 |
|
|
| 72 |
|
error_cat_type error_cat;
|
72 |
|
error_cat_type error_cat;
|
| 73 |
|
|
73 |
|
|
| 74 |
|
|
74 |
|
|
| 75 |
|
#if defined(_MSC_VER) && _MSC_VER <= 1900
|
75 |
|
#if defined(_MSC_VER) && _MSC_VER <= 1900
|
| 76 |
|
|
76 |
|
|
| 77 |
|
|
77 |
|
|
| 78 |
|
|
78 |
|
|
| 79 |
|
|
79 |
|
|
| 80 |
|
|
80 |
|
|
| 81 |
|
|
81 |
|
|
| 82 |
|
|
82 |
|
|