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

Commit8c9346e

Browse files
committed
Merge pull request#459 from kencoken/0.11-devel
Fix already fulfilled promise errors on long downloads + added namespacing to status constants
2 parents53f3479 +f006a79 commit8c9346e

File tree

3 files changed

+39
-34
lines changed

3 files changed

+39
-34
lines changed

‎boost/network/protocol/http/client/connection/async_normal.hpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,12 @@ struct http_async_connection
442442
case headers:
443443
this->headers_promise.set_exception(boost::copy_exception(error));
444444
case body:
445-
this->body_promise.set_exception(boost::copy_exception(error));
445+
if (!callback) {
446+
// N.B. if callback is non-null, then body_promise has
447+
// already been set to value "" to indicate body is
448+
// handled by streaming handler so no exception should be set
449+
this->body_promise.set_exception(boost::copy_exception(error));
450+
}
446451
break;
447452
default:
448453
BOOST_ASSERT(false &&"Bug, report this to the developers!");

‎boost/network/protocol/http/traits/impl/response_code.ipp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ namespace http {
2323
*/
2424
template<classTag>
2525
structresponse_code {
26-
static boost::uint16_tconstOK =200u;
27-
static boost::uint16_tconstCREATED =201u;
28-
static boost::uint16_tconstNO_CONTENT =204u;
29-
static boost::uint16_tconstUNAUTHORIZED =401u;
30-
static boost::uint16_tconstFORBIDDEN =403u;
31-
static boost::uint16_tconstNOT_FOUND =404u;
32-
static boost::uint16_tconstMETHOD_NOT_ALLOWED =405u;
33-
static boost::uint16_tconstNOT_MODIFIED =304u;
34-
static boost::uint16_tconstBAD_REQUEST =400u;
35-
static boost::uint16_tconstSERVER_ERROR =500u;
36-
static boost::uint16_tconstNOT_IMPLEMENTED =501u;
26+
static boost::uint16_tconstRC_OK =200u;
27+
static boost::uint16_tconstRC_CREATED =201u;
28+
static boost::uint16_tconstRC_NO_CONTENT =204u;
29+
static boost::uint16_tconstRC_UNAUTHORIZED =401u;
30+
static boost::uint16_tconstRC_FORBIDDEN =403u;
31+
static boost::uint16_tconstRC_NOT_FOUND =404u;
32+
static boost::uint16_tconstRC_METHOD_NOT_ALLOWED =405u;
33+
static boost::uint16_tconstRC_NOT_MODIFIED =304u;
34+
static boost::uint16_tconstRC_BAD_REQUEST =400u;
35+
static boost::uint16_tconstRC_SERVER_ERROR =500u;
36+
static boost::uint16_tconstRC_NOT_IMPLEMENTED =501u;
3737
};
3838

3939
}// namespace http

‎boost/network/protocol/http/traits/impl/response_message.ipp

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,58 +16,58 @@ namespace http {
1616
template<>
1717
structresponse_message<tags::http_default_8bit_tcp_resolve> {
1818
staticcharconst*ok() {
19-
staticcharconst*constOK ="OK";
20-
returnOK;
19+
staticcharconst*constRC_OK ="OK";
20+
returnRC_OK;
2121
};
2222

2323
staticcharconst*created() {
24-
staticcharconst*constCREATED ="Created";
25-
returnCREATED;
24+
staticcharconst*constRC_CREATED ="Created";
25+
returnRC_CREATED;
2626
};
2727

2828
staticcharconst*no_content() {
29-
staticcharconst*constNO_CONTENT ="NO Content";
30-
returnNO_CONTENT;
29+
staticcharconst*constRC_NO_CONTENT ="NO Content";
30+
returnRC_NO_CONTENT;
3131
};
3232

3333
staticcharconst*unauthorized() {
34-
staticcharconst*constUNAUTHORIZED ="Unauthorized";
35-
returnUNAUTHORIZED;
34+
staticcharconst*constRC_UNAUTHORIZED ="Unauthorized";
35+
returnRC_UNAUTHORIZED;
3636
};
3737

3838
staticcharconst*forbidden() {
39-
staticcharconst*constFORBIDDEN ="Fobidden";
40-
returnFORBIDDEN;
39+
staticcharconst*constRC_FORBIDDEN ="Fobidden";
40+
returnRC_FORBIDDEN;
4141
};
4242

4343
staticcharconst*not_found() {
44-
staticcharconst*constNOT_FOUND ="Not Found";
45-
returnNOT_FOUND;
44+
staticcharconst*constRC_NOT_FOUND ="Not Found";
45+
returnRC_NOT_FOUND;
4646
};
4747

4848
staticcharconst*method_not_allowed() {
49-
staticcharconst*constMETHOD_NOT_ALLOWED ="Method Not Allowed";
50-
returnMETHOD_NOT_ALLOWED;
49+
staticcharconst*constRC_METHOD_NOT_ALLOWED ="Method Not Allowed";
50+
returnRC_METHOD_NOT_ALLOWED;
5151
};
5252

5353
staticcharconst*not_modified() {
54-
staticcharconst*constNOT_MODIFIED ="Not Modified";
55-
returnNOT_MODIFIED;
54+
staticcharconst*constRC_NOT_MODIFIED ="Not Modified";
55+
returnRC_NOT_MODIFIED;
5656
};
5757

5858
staticcharconst*bad_request() {
59-
staticcharconst*constBAD_REQUEST ="Bad Request";
60-
returnBAD_REQUEST;
59+
staticcharconst*constRC_BAD_REQUEST ="Bad Request";
60+
returnRC_BAD_REQUEST;
6161
};
6262

6363
staticcharconst*server_error() {
64-
staticcharconst*constSERVER_ERROR ="Server Error";
65-
returnSERVER_ERROR;
64+
staticcharconst*constRC_SERVER_ERROR ="Server Error";
65+
returnRC_SERVER_ERROR;
6666
};
6767

6868
staticcharconst*not_implemented() {
69-
staticcharconst*constNOT_IMPLEMENTED ="Not Implemented";
70-
returnNOT_IMPLEMENTED;
69+
staticcharconst*constRC_NOT_IMPLEMENTED ="Not Implemented";
70+
returnRC_NOT_IMPLEMENTED;
7171
};
7272
};
7373

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp