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

Commita3dfcdb

Browse files
committed
Update async_normal.hpp
1 parent2b49830 commita3dfcdb

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,12 @@ struct http_async_connection
9595
this->method = method;
9696
boost::uint16_t port_ =port(request);
9797
string_type host_ =host(request);
98+
boost::uint16_t source_port = request.getSourcePort();
99+
98100
resolve_(resolver_, host_, port_,
99101
request_strand_.wrap(boost::bind(
100102
&this_type::handle_resolved,this_type::shared_from_this(),
101-
host_, port_, get_body, callback,
103+
host_, port_,source_port,get_body, callback,
102104
generator, boost::arg<1>(), boost::arg<2>())));
103105
if (timeout_ >0) {
104106
timer_.expires_from_now(boost::posix_time::seconds(timeout_));
@@ -129,7 +131,7 @@ struct http_async_connection
129131
is_timedout_ =true;
130132
}
131133

132-
voidhandle_resolved(string_type host, boost::uint16_t port,bool get_body,
134+
voidhandle_resolved(string_type host, boost::uint16_t port,boost::uint16_t source_port,bool get_body,
133135
body_callback_function_type callback,
134136
body_generator_function_type generator,
135137
boost::system::error_codeconst& ec,
@@ -141,10 +143,10 @@ struct http_async_connection
141143
resolver_iterator iter =boost::begin(endpoint_range);
142144
asio::ip::tcp::endpointendpoint(iter->endpoint().address(), port);
143145
delegate_->connect(
144-
endpoint, host,
146+
endpoint, host, source_port,
145147
request_strand_.wrap(boost::bind(
146148
&this_type::handle_connected,this_type::shared_from_this(), host,
147-
port, get_body, callback, generator,
149+
port,source_port,get_body, callback, generator,
148150
std::make_pair(++iter,resolver_iterator()),
149151
placeholders::error)));
150152
}else {
@@ -154,7 +156,7 @@ struct http_async_connection
154156
}
155157
}
156158

157-
voidhandle_connected(string_type host, boost::uint16_t port,bool get_body,
159+
voidhandle_connected(string_type host, boost::uint16_t port,boost::uint16_t source_port,bool get_body,
158160
body_callback_function_type callback,
159161
body_generator_function_type generator,
160162
resolver_iterator_pair endpoint_range,
@@ -174,10 +176,10 @@ struct http_async_connection
174176
resolver_iterator iter =boost::begin(endpoint_range);
175177
asio::ip::tcp::endpointendpoint(iter->endpoint().address(), port);
176178
delegate_->connect(
177-
endpoint, host,
179+
endpoint, host, source_port,
178180
request_strand_.wrap(boost::bind(
179181
&this_type::handle_connected,this_type::shared_from_this(),
180-
host, port, get_body, callback, generator,
182+
host, port,source_port,get_body, callback, generator,
181183
std::make_pair(++iter,resolver_iterator()),
182184
placeholders::error)));
183185
}else {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp