Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2aec5ea

Browse files
committed
Pull out status_t to the top level to allow using those enum values from clients.
1 parent540ed76 commit2aec5ea

File tree

2 files changed

+41
-26
lines changed

2 files changed

+41
-26
lines changed

‎boost/network/protocol/http/server/async_connection.hpp‎

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include<boost/asio/write.hpp>
2424
#include<boost/network/protocol/http/algorithms/linearize.hpp>
2525
#include<boost/network/protocol/http/server/request_parser.hpp>
26+
#include<boost/network/protocol/http/status.hpp>
2627
#include<boost/network/protocol/stream_handler.hpp>
2728
#include<boost/network/utils/thread_pool.hpp>
2829
#include<boost/optional.hpp>
@@ -71,32 +72,7 @@ extern void parse_headers(std::string const& input,
7172
template<classTag,classHandler>
7273
structasync_connection
7374
: std::enable_shared_from_this<async_connection<Tag, Handler> > {
74-
/// The set of known status codes for HTTP server responses.
75-
enumstatus_t {
76-
ok =200,
77-
created =201,
78-
accepted =202,
79-
no_content =204,
80-
partial_content =206,
81-
multiple_choices =300,
82-
moved_permanently =301,
83-
moved_temporarily =302,
84-
not_modified =304,
85-
bad_request =400,
86-
unauthorized =401,
87-
forbidden =403,
88-
not_found =404,
89-
not_supported =405,
90-
not_acceptable =406,
91-
request_timeout =408,
92-
precondition_failed =412,
93-
unsatisfiable_range =416,
94-
internal_server_error =500,
95-
not_implemented =501,
96-
bad_gateway =502,
97-
service_unavailable =503,
98-
space_unavailable =507
99-
};
75+
typedef boost::network::http::status_tstatus_t;
10076

10177
typedeftypename string<Tag>::type string_type;
10278
typedef basic_request<Tag> request;
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#ifndef BOOST_NETWORK_PROTOCOL_HTTP_STATUS_HPP_20180501
2+
#defineBOOST_NETWORK_PROTOCOL_HTTP_STATUS_HPP_20180501
3+
4+
namespaceboost {
5+
namespacenetwork {
6+
namespacehttp {
7+
8+
/// The set of known status codes for HTTP server responses.
9+
enumstatus_t {
10+
ok =200,
11+
created =201,
12+
accepted =202,
13+
no_content =204,
14+
partial_content =206,
15+
multiple_choices =300,
16+
moved_permanently =301,
17+
moved_temporarily =302,
18+
not_modified =304,
19+
bad_request =400,
20+
unauthorized =401,
21+
forbidden =403,
22+
not_found =404,
23+
not_supported =405,
24+
not_acceptable =406,
25+
request_timeout =408,
26+
precondition_failed =412,
27+
unsatisfiable_range =416,
28+
internal_server_error =500,
29+
not_implemented =501,
30+
bad_gateway =502,
31+
service_unavailable =503,
32+
space_unavailable =507,
33+
};
34+
35+
}// namespace http
36+
}// namespace network
37+
}// namespace boost
38+
39+
#endif// BOOST_NETWORK_PROTOCOL_HTTP_STATUS_HPP_20180501

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp