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

Commit57f1e97

Browse files
author
Pavel Punsky
committed
Fixes crashes on unstable network
Instead of evaluating host asynchronously, pass host as string_type intoresolve. Can crash because request does not exist at the time ofevaluation of bind in some cases
1 parent7765e6e commit57f1e97

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,11 @@ struct http_async_connection
9494
&command_streambuf));
9595
this->method = method;
9696
boost::uint16_t port_ =port(request);
97-
resolve_(resolver_,host(request), port_,
97+
string_type host_ =host(request);
98+
resolve_(resolver_, host_, port_,
9899
request_strand_.wrap(boost::bind(
99100
&this_type::handle_resolved,this_type::shared_from_this(),
100-
string_type(host(request)), port_, get_body, callback,
101+
host_, port_, get_body, callback,
101102
generator, boost::arg<1>(), boost::arg<2>())));
102103
if (timeout_ >0) {
103104
timer_.expires_from_now(boost::posix_time::seconds(timeout_));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp