@@ -46,14 +46,14 @@ namespace boost { namespace network { namespace http { namespace impl {
4646typedef typename base::resolver_base::resolve_function resolve_function;
4747
4848http_async_connection (
49- boost::shared_ptr< resolver_type> resolver,
49+ resolver_type & resolver,
5050 resolve_function resolve,
5151bool follow_redirect
5252 ) :
5353follow_redirect_ (follow_redirect),
5454resolver_ (resolver),
5555resolve_ (resolve),
56- request_strand_ (new boost::asio::io_service::strand( resolver-> get_io_service () ))
56+ request_strand_ (resolver. get_io_service())
5757 {}
5858
5959
@@ -65,7 +65,7 @@ namespace boost { namespace network { namespace http { namespace impl {
6565 boost::uint16_t port_ =port (request);
6666resolve_ (resolver_,host (request),
6767 port_,
68- request_strand_-> wrap (
68+ request_strand_. wrap (
6969boost::bind (
7070 &http_async_connection<Tag,version_major,version_minor>::handle_resolved,
7171 http_async_connection<Tag,version_major,version_minor>::shared_from_this (),
@@ -83,10 +83,10 @@ namespace boost { namespace network { namespace http { namespace impl {
8383 port
8484 );
8585 socket_.reset (new boost::asio::ip::tcp::socket (
86- resolver_-> get_io_service ()));
86+ resolver_. get_io_service ()));
8787 socket_->async_connect (
8888 endpoint,
89- request_strand_-> wrap (
89+ request_strand_. wrap (
9090boost::bind (
9191 &http_async_connection<Tag,version_major,version_minor>::handle_connected,
9292 http_async_connection<Tag,version_major,version_minor>::shared_from_this (),
@@ -108,7 +108,7 @@ namespace boost { namespace network { namespace http { namespace impl {
108108void handle_connected (boost::uint16_t port,bool get_body, resolver_iterator_pair endpoint_range, boost::system::error_codeconst & ec) {
109109if (!ec) {
110110boost::asio::async_write (*socket_,boost::asio::buffer (command_string_.data (), command_string_.size ()),
111- request_strand_-> wrap (
111+ request_strand_. wrap (
112112boost::bind (
113113 &http_async_connection<Tag,version_major,version_minor>::handle_sent_request,
114114 http_async_connection<Tag,version_major,version_minor>::shared_from_this (),
@@ -124,10 +124,10 @@ namespace boost { namespace network { namespace http { namespace impl {
124124 port
125125 );
126126 socket_.reset (new boost::asio::ip::tcp::socket (
127- resolver_-> get_io_service ()));
127+ resolver_. get_io_service ()));
128128 socket_->async_connect (
129129 endpoint,
130- request_strand_-> wrap (
130+ request_strand_. wrap (
131131boost::bind (
132132 &http_async_connection<Tag,version_major,version_minor>::handle_connected,
133133 http_async_connection<Tag,version_major,version_minor>::shared_from_this (),
@@ -160,7 +160,7 @@ namespace boost { namespace network { namespace http { namespace impl {
160160boost::asio::mutable_buffers_1 (
161161this ->part .c_array (),
162162this ->part .size ()),
163- request_strand_-> wrap (
163+ request_strand_. wrap (
164164boost::bind (
165165 &http_async_connection<Tag,version_major,version_minor>::handle_received_data,
166166 http_async_connection<Tag,version_major,version_minor>::shared_from_this (),
@@ -187,7 +187,7 @@ namespace boost { namespace network { namespace http { namespace impl {
187187case version:
188188 parsed_ok =
189189this ->parse_version (*socket_,
190- request_strand_-> wrap (
190+ request_strand_. wrap (
191191boost::bind (
192192 &http_async_connection<Tag,version_major,version_minor>::handle_received_data,
193193 http_async_connection<Tag,version_major,version_minor>::shared_from_this (),
@@ -199,7 +199,7 @@ namespace boost { namespace network { namespace http { namespace impl {
199199case status:
200200 parsed_ok =
201201this ->parse_status (*socket_,
202- request_strand_-> wrap (
202+ request_strand_. wrap (
203203boost::bind (
204204 &http_async_connection<Tag,version_major,version_minor>::handle_received_data,
205205 http_async_connection<Tag,version_major,version_minor>::shared_from_this (),
@@ -211,7 +211,7 @@ namespace boost { namespace network { namespace http { namespace impl {
211211case status_message:
212212 parsed_ok =
213213this ->parse_status_message (*socket_,
214- request_strand_-> wrap (
214+ request_strand_. wrap (
215215boost::bind (
216216 &http_async_connection<Tag,version_major,version_minor>::handle_received_data,
217217 http_async_connection<Tag,version_major,version_minor>::shared_from_this (),
@@ -223,7 +223,7 @@ namespace boost { namespace network { namespace http { namespace impl {
223223case headers:
224224fusion::tie (parsed_ok, remainder) =
225225this ->parse_headers (*socket_,
226- request_strand_-> wrap (
226+ request_strand_. wrap (
227227boost::bind (
228228 &http_async_connection<Tag,version_major,version_minor>::handle_received_data,
229229 http_async_connection<Tag,version_major,version_minor>::shared_from_this (),
@@ -238,7 +238,7 @@ namespace boost { namespace network { namespace http { namespace impl {
238238 }
239239this ->parse_body (
240240 *socket_,
241- request_strand_-> wrap (
241+ request_strand_. wrap (
242242boost::bind (
243243 &http_async_connection<Tag,version_major,version_minor>::handle_received_data,
244244 http_async_connection<Tag,version_major,version_minor>::shared_from_this (),
@@ -268,7 +268,7 @@ namespace boost { namespace network { namespace http { namespace impl {
268268 }else {
269269this ->parse_body (
270270 *socket_,
271- request_strand_-> wrap (
271+ request_strand_. wrap (
272272boost::bind (
273273 &http_async_connection<Tag,version_major,version_minor>::handle_received_data,
274274 http_async_connection<Tag,version_major,version_minor>::shared_from_this (),
@@ -304,10 +304,10 @@ namespace boost { namespace network { namespace http { namespace impl {
304304 }
305305
306306bool follow_redirect_;
307- boost::shared_ptr< resolver_type> resolver_;
307+ resolver_type & resolver_;
308308 boost::shared_ptr<boost::asio::ip::tcp::socket> socket_;
309309 resolve_function resolve_;
310- boost::shared_ptr<boost:: asio::io_service::strand> request_strand_;
310+ boost::asio::io_service::strand request_strand_;
311311 string_type command_string_;
312312 string_type method;
313313 };