@@ -46,14 +46,14 @@ namespace boost { namespace network { namespace http { namespace impl {
46
46
typedef typename base::resolver_base::resolve_function resolve_function;
47
47
48
48
http_async_connection (
49
- boost::shared_ptr< resolver_type> resolver,
49
+ resolver_type & resolver,
50
50
resolve_function resolve,
51
51
bool follow_redirect
52
52
) :
53
53
follow_redirect_ (follow_redirect),
54
54
resolver_ (resolver),
55
55
resolve_ (resolve),
56
- request_strand_ (new boost::asio::io_service::strand( resolver-> get_io_service () ))
56
+ request_strand_ (resolver. get_io_service())
57
57
{}
58
58
59
59
@@ -65,7 +65,7 @@ namespace boost { namespace network { namespace http { namespace impl {
65
65
boost::uint16_t port_ = port (request);
66
66
resolve_ (resolver_, host (request),
67
67
port_,
68
- request_strand_-> wrap (
68
+ request_strand_. wrap (
69
69
boost::bind (
70
70
&http_async_connection<Tag,version_major,version_minor>::handle_resolved,
71
71
http_async_connection<Tag,version_major,version_minor>::shared_from_this (),
@@ -83,10 +83,10 @@ namespace boost { namespace network { namespace http { namespace impl {
83
83
port
84
84
);
85
85
socket_.reset (new boost::asio::ip::tcp::socket (
86
- resolver_-> get_io_service ()));
86
+ resolver_. get_io_service ()));
87
87
socket_->async_connect (
88
88
endpoint,
89
- request_strand_-> wrap (
89
+ request_strand_. wrap (
90
90
boost::bind (
91
91
&http_async_connection<Tag,version_major,version_minor>::handle_connected,
92
92
http_async_connection<Tag,version_major,version_minor>::shared_from_this (),
@@ -108,7 +108,7 @@ namespace boost { namespace network { namespace http { namespace impl {
108
108
void handle_connected (boost::uint16_t port, bool get_body, resolver_iterator_pair endpoint_range, boost::system::error_code const & ec) {
109
109
if (!ec) {
110
110
boost::asio::async_write (*socket_, boost::asio::buffer (command_string_.data (), command_string_.size ()),
111
- request_strand_-> wrap (
111
+ request_strand_. wrap (
112
112
boost::bind (
113
113
&http_async_connection<Tag,version_major,version_minor>::handle_sent_request,
114
114
http_async_connection<Tag,version_major,version_minor>::shared_from_this (),
@@ -124,10 +124,10 @@ namespace boost { namespace network { namespace http { namespace impl {
124
124
port
125
125
);
126
126
socket_.reset (new boost::asio::ip::tcp::socket (
127
- resolver_-> get_io_service ()));
127
+ resolver_. get_io_service ()));
128
128
socket_->async_connect (
129
129
endpoint,
130
- request_strand_-> wrap (
130
+ request_strand_. wrap (
131
131
boost::bind (
132
132
&http_async_connection<Tag,version_major,version_minor>::handle_connected,
133
133
http_async_connection<Tag,version_major,version_minor>::shared_from_this (),
@@ -160,7 +160,7 @@ namespace boost { namespace network { namespace http { namespace impl {
160
160
boost::asio::mutable_buffers_1 (
161
161
this ->part .c_array (),
162
162
this ->part .size ()),
163
- request_strand_-> wrap (
163
+ request_strand_. wrap (
164
164
boost::bind (
165
165
&http_async_connection<Tag,version_major,version_minor>::handle_received_data,
166
166
http_async_connection<Tag,version_major,version_minor>::shared_from_this (),
@@ -187,7 +187,7 @@ namespace boost { namespace network { namespace http { namespace impl {
187
187
case version:
188
188
parsed_ok =
189
189
this ->parse_version (*socket_,
190
- request_strand_-> wrap (
190
+ request_strand_. wrap (
191
191
boost::bind (
192
192
&http_async_connection<Tag,version_major,version_minor>::handle_received_data,
193
193
http_async_connection<Tag,version_major,version_minor>::shared_from_this (),
@@ -199,7 +199,7 @@ namespace boost { namespace network { namespace http { namespace impl {
199
199
case status:
200
200
parsed_ok =
201
201
this ->parse_status (*socket_,
202
- request_strand_-> wrap (
202
+ request_strand_. wrap (
203
203
boost::bind (
204
204
&http_async_connection<Tag,version_major,version_minor>::handle_received_data,
205
205
http_async_connection<Tag,version_major,version_minor>::shared_from_this (),
@@ -211,7 +211,7 @@ namespace boost { namespace network { namespace http { namespace impl {
211
211
case status_message:
212
212
parsed_ok =
213
213
this ->parse_status_message (*socket_,
214
- request_strand_-> wrap (
214
+ request_strand_. wrap (
215
215
boost::bind (
216
216
&http_async_connection<Tag,version_major,version_minor>::handle_received_data,
217
217
http_async_connection<Tag,version_major,version_minor>::shared_from_this (),
@@ -223,7 +223,7 @@ namespace boost { namespace network { namespace http { namespace impl {
223
223
case headers:
224
224
fusion::tie (parsed_ok, remainder) =
225
225
this ->parse_headers (*socket_,
226
- request_strand_-> wrap (
226
+ request_strand_. wrap (
227
227
boost::bind (
228
228
&http_async_connection<Tag,version_major,version_minor>::handle_received_data,
229
229
http_async_connection<Tag,version_major,version_minor>::shared_from_this (),
@@ -238,7 +238,7 @@ namespace boost { namespace network { namespace http { namespace impl {
238
238
}
239
239
this ->parse_body (
240
240
*socket_,
241
- request_strand_-> wrap (
241
+ request_strand_. wrap (
242
242
boost::bind (
243
243
&http_async_connection<Tag,version_major,version_minor>::handle_received_data,
244
244
http_async_connection<Tag,version_major,version_minor>::shared_from_this (),
@@ -268,7 +268,7 @@ namespace boost { namespace network { namespace http { namespace impl {
268
268
} else {
269
269
this ->parse_body (
270
270
*socket_,
271
- request_strand_-> wrap (
271
+ request_strand_. wrap (
272
272
boost::bind (
273
273
&http_async_connection<Tag,version_major,version_minor>::handle_received_data,
274
274
http_async_connection<Tag,version_major,version_minor>::shared_from_this (),
@@ -304,10 +304,10 @@ namespace boost { namespace network { namespace http { namespace impl {
304
304
}
305
305
306
306
bool follow_redirect_;
307
- boost::shared_ptr< resolver_type> resolver_;
307
+ resolver_type & resolver_;
308
308
boost::shared_ptr<boost::asio::ip::tcp::socket> socket_;
309
309
resolve_function resolve_;
310
- boost::shared_ptr<boost:: asio::io_service::strand> request_strand_;
310
+ boost::asio::io_service::strand request_strand_;
311
311
string_type command_string_;
312
312
string_type method;
313
313
};
0 commit comments