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

Setting source port#551

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Update async_normal.hpp
  • Loading branch information
@DanielBujnik
DanielBujnik committedAug 13, 2015
commita3dfcdbc8f91d70696f6ff08706e4f1db152ece1
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -95,10 +95,12 @@ struct http_async_connection
this->method = method;
boost::uint16_t port_ = port(request);
string_type host_ = host(request);
boost::uint16_t source_port = request.getSourcePort();

resolve_(resolver_, host_, port_,
request_strand_.wrap(boost::bind(
&this_type::handle_resolved, this_type::shared_from_this(),
host_, port_, get_body, callback,
host_, port_,source_port,get_body, callback,
generator, boost::arg<1>(), boost::arg<2>())));
if (timeout_ > 0) {
timer_.expires_from_now(boost::posix_time::seconds(timeout_));
Expand DownExpand Up@@ -129,7 +131,7 @@ struct http_async_connection
is_timedout_ = true;
}

void handle_resolved(string_type host, boost::uint16_t port, bool get_body,
void handle_resolved(string_type host, boost::uint16_t port,boost::uint16_t source_port,bool get_body,
body_callback_function_type callback,
body_generator_function_type generator,
boost::system::error_code const& ec,
Expand All@@ -141,10 +143,10 @@ struct http_async_connection
resolver_iterator iter = boost::begin(endpoint_range);
asio::ip::tcp::endpoint endpoint(iter->endpoint().address(), port);
delegate_->connect(
endpoint, host,
endpoint, host, source_port,
request_strand_.wrap(boost::bind(
&this_type::handle_connected, this_type::shared_from_this(), host,
port, get_body, callback, generator,
port,source_port,get_body, callback, generator,
std::make_pair(++iter, resolver_iterator()),
placeholders::error)));
} else {
Expand All@@ -154,7 +156,7 @@ struct http_async_connection
}
}

void handle_connected(string_type host, boost::uint16_t port, bool get_body,
void handle_connected(string_type host, boost::uint16_t port,boost::uint16_t source_port,bool get_body,
body_callback_function_type callback,
body_generator_function_type generator,
resolver_iterator_pair endpoint_range,
Expand All@@ -174,10 +176,10 @@ struct http_async_connection
resolver_iterator iter = boost::begin(endpoint_range);
asio::ip::tcp::endpoint endpoint(iter->endpoint().address(), port);
delegate_->connect(
endpoint, host,
endpoint, host, source_port,
request_strand_.wrap(boost::bind(
&this_type::handle_connected, this_type::shared_from_this(),
host, port, get_body, callback, generator,
host, port,source_port,get_body, callback, generator,
std::make_pair(++iter, resolver_iterator()),
placeholders::error)));
} else {
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp