@@ -97,7 +97,7 @@ struct http_async_connection
97
97
resolve_ (
98
98
resolver_, host (request), port_,
99
99
request_strand_.wrap (boost::bind (
100
- &this_type::handle_resolved, this_type::shared_from_this (), port_,
100
+ &this_type::handle_resolved, this_type::shared_from_this (), host (request), port_,
101
101
get_body, callback, generator, boost::arg<1 >(), boost::arg<2 >())));
102
102
if (timeout_ > 0 ) {
103
103
timer_.expires_from_now (boost::posix_time::seconds (timeout_));
@@ -128,7 +128,7 @@ struct http_async_connection
128
128
is_timedout_ = true ;
129
129
}
130
130
131
- void handle_resolved (boost::uint16_t port, bool get_body,
131
+ void handle_resolved (string_type host, boost::uint16_t port, bool get_body,
132
132
body_callback_function_type callback,
133
133
body_generator_function_type generator,
134
134
boost::system::error_code const & ec,
@@ -140,9 +140,9 @@ struct http_async_connection
140
140
resolver_iterator iter = boost::begin (endpoint_range);
141
141
asio::ip::tcp::endpoint endpoint (iter->endpoint ().address (), port);
142
142
delegate_->connect (
143
- endpoint, request_strand_.wrap (boost::bind (
143
+ endpoint, host, request_strand_.wrap (boost::bind (
144
144
&this_type::handle_connected,
145
- this_type::shared_from_this (), port, get_body, callback,
145
+ this_type::shared_from_this (), host, port, get_body, callback,
146
146
generator, std::make_pair (++iter, resolver_iterator ()),
147
147
placeholders::error)));
148
148
} else {
@@ -152,7 +152,7 @@ struct http_async_connection
152
152
}
153
153
}
154
154
155
- void handle_connected (boost::uint16_t port, bool get_body,
155
+ void handle_connected (string_type host, boost::uint16_t port, bool get_body,
156
156
body_callback_function_type callback,
157
157
body_generator_function_type generator,
158
158
resolver_iterator_pair endpoint_range,
@@ -173,9 +173,10 @@ struct http_async_connection
173
173
asio::ip::tcp::endpoint endpoint (iter->endpoint ().address (), port);
174
174
delegate_->connect (
175
175
endpoint,
176
+ host,
176
177
request_strand_.wrap (boost::bind (
177
178
&this_type::handle_connected, this_type::shared_from_this (),
178
- port, get_body, callback, generator,
179
+ host, port, get_body, callback, generator,
179
180
std::make_pair (++iter, resolver_iterator ()),
180
181
placeholders::error)));
181
182
} else {
0 commit comments