@@ -68,19 +68,21 @@ struct http_async_connection_pimpl : std::enable_shared_from_this<http_async_con
68
68
boost::uint16_t port_ = port (request);
69
69
NETWORK_MESSAGE (" port: " << port_);
70
70
this ->host_ = host (request);
71
-
71
+
72
+ using namespace std ::placeholders;
73
+
72
74
resolver_delegate_->resolve (
73
75
this ->host_ ,
74
76
port_,
75
77
request_strand_.wrap (
76
- boost ::bind (
78
+ std ::bind (
77
79
&this_type::handle_resolved,
78
- this_type::shared_from_this (),
80
+ std::ref (* this_type::shared_from_this () ),
79
81
port_,
80
82
get_body,
81
83
callback,
82
- boost::asio:: placeholders::error ,
83
- boost::asio:: placeholders::bytes_transferred )));
84
+ std:: placeholders::_1 ,
85
+ std:: placeholders::_2 )));
84
86
return response_;
85
87
}
86
88
@@ -141,20 +143,22 @@ struct http_async_connection_pimpl : std::enable_shared_from_this<http_async_con
141
143
NETWORK_MESSAGE (" trying connection to: "
142
144
<< iter->endpoint ().address () << " :" << port);
143
145
boost::asio::ip::tcp::endpoint endpoint (iter->endpoint ().address (), port);
144
-
146
+
147
+ using namespace std ::placeholders;
148
+
145
149
connection_delegate_->connect (
146
150
endpoint,
147
151
this ->host_ ,
148
152
request_strand_.wrap (
149
- boost ::bind (
153
+ std ::bind (
150
154
&this_type::handle_connected,
151
- this_type::shared_from_this () ,
155
+ this ,
152
156
port,
153
157
get_body,
154
158
callback,
155
159
std::make_pair (++iter,
156
160
resolver_iterator ()),
157
- boost::asio:: placeholders::error )));
161
+ std:: placeholders::_1 )));
158
162
} else {
159
163
NETWORK_MESSAGE (" error encountered while resolving." );
160
164
set_errors (ec ? ec : boost::asio::error::host_not_found);
@@ -174,13 +178,13 @@ struct http_async_connection_pimpl : std::enable_shared_from_this<http_async_con
174
178
175
179
connection_delegate_->write (command_streambuf,
176
180
request_strand_.wrap (
177
- boost ::bind (
181
+ std ::bind (
178
182
&this_type::handle_sent_request,
179
- this_type::shared_from_this () ,
183
+ this ,
180
184
get_body,
181
185
callback,
182
- boost::asio:: placeholders::error ,
183
- boost::asio:: placeholders::bytes_transferred )));
186
+ std:: placeholders::_1 ,
187
+ std:: placeholders::_2 )));
184
188
} else {
185
189
NETWORK_MESSAGE (" connection unsuccessful" );
186
190
if (!boost::empty (endpoint_range)) {
@@ -191,15 +195,15 @@ struct http_async_connection_pimpl : std::enable_shared_from_this<http_async_con
191
195
connection_delegate_->connect (endpoint,
192
196
this ->host_ ,
193
197
request_strand_.wrap (
194
- boost ::bind (
198
+ std ::bind (
195
199
&this_type::handle_connected,
196
- this_type::shared_from_this () ,
200
+ this ,
197
201
port,
198
202
get_body,
199
203
callback,
200
204
std::make_pair (++iter,
201
205
resolver_iterator ()),
202
- boost::asio:: placeholders::error )));
206
+ std:: placeholders::_1 )));
203
207
} else {
204
208
set_errors (ec ? ec : boost::asio::error::host_not_found);
205
209
}
@@ -222,11 +226,11 @@ struct http_async_connection_pimpl : std::enable_shared_from_this<http_async_con
222
226
boost::asio::mutable_buffers_1 (this ->part .c_array (),
223
227
this ->part .size ()),
224
228
request_strand_.wrap (
225
- boost ::bind (&this_type::handle_received_data,
229
+ std ::bind (&this_type::handle_received_data,
226
230
this_type::shared_from_this (),
227
231
version, get_body, callback,
228
- boost::asio:: placeholders::error ,
229
- boost::asio:: placeholders::bytes_transferred )));
232
+ std:: placeholders::_1 ,
233
+ std:: placeholders::_2 )));
230
234
} else {
231
235
NETWORK_MESSAGE (" request sent unsuccessfully; setting errors" );
232
236
set_errors (ec);
@@ -258,36 +262,37 @@ struct http_async_connection_pimpl : std::enable_shared_from_this<http_async_con
258
262
NETWORK_MESSAGE (" parsing version..." );
259
263
parsed_ok =
260
264
this ->parse_version (request_strand_.wrap (
261
- boost ::bind (
265
+ std ::bind (
262
266
&this_type::handle_received_data,
263
- this_type::shared_from_this () ,
267
+ this ,
264
268
version, get_body, callback,
265
- boost::asio:: placeholders::error ,
266
- boost::asio:: placeholders::bytes_transferred )),
269
+ std:: placeholders::_1 ,
270
+ std:: placeholders::_2 )),
267
271
bytes_transferred);
268
272
if (!parsed_ok || indeterminate (parsed_ok)) return ;
269
273
case status:
270
274
NETWORK_MESSAGE (" parsing status..." );
271
275
parsed_ok =
272
276
this ->parse_status (request_strand_.wrap (
273
- boost ::bind (
277
+ std ::bind (
274
278
&this_type::handle_received_data,
275
- this_type::shared_from_this () ,
279
+ this ,
276
280
status, get_body, callback,
277
- boost::asio:: placeholders::error ,
278
- boost::asio:: placeholders::bytes_transferred )),
281
+ std:: placeholders::_1 ,
282
+ std:: placeholders::_2 )),
279
283
bytes_transferred);
280
284
if (!parsed_ok || indeterminate (parsed_ok)) return ;
281
285
case status_message:
282
286
NETWORK_MESSAGE (" parsing status message..." );
283
287
parsed_ok =
284
288
this ->parse_status_message (
285
289
request_strand_.wrap (
286
- boost ::bind (
290
+ std ::bind (
287
291
&this_type::handle_received_data,
288
- this_type::shared_from_this () ,
292
+ this ,
289
293
status_message, get_body, callback,
290
- boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred
294
+ std::placeholders::_1,
295
+ std::placeholders::_2
291
296
)
292
297
),
293
298
bytes_transferred
@@ -302,11 +307,12 @@ struct http_async_connection_pimpl : std::enable_shared_from_this<http_async_con
302
307
boost::fusion::tie (parsed_ok, remainder) =
303
308
this ->parse_headers (
304
309
request_strand_.wrap (
305
- boost ::bind (
310
+ std ::bind (
306
311
&this_type::handle_received_data,
307
312
this_type::shared_from_this (),
308
313
headers, get_body, callback,
309
- boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred
314
+ std::placeholders::_1,
315
+ std::placeholders::_2
310
316
)
311
317
),
312
318
bytes_transferred
@@ -353,24 +359,25 @@ struct http_async_connection_pimpl : std::enable_shared_from_this<http_async_con
353
359
boost::asio::mutable_buffers_1 (this ->part .c_array (),
354
360
this ->part .size ()),
355
361
request_strand_.wrap (
356
- boost ::bind (&this_type::handle_received_data,
357
- this_type::shared_from_this () ,
362
+ std ::bind (&this_type::handle_received_data,
363
+ this ,
358
364
body,
359
365
get_body,
360
366
callback,
361
- boost::asio:: placeholders::error ,
362
- boost::asio:: placeholders::bytes_transferred )));
367
+ std:: placeholders::_1 ,
368
+ std:: placeholders::_2 )));
363
369
} else {
364
370
NETWORK_MESSAGE (" no callback provided, appending to body..." );
365
371
// Here we handle the body data ourself and append to an
366
372
// ever-growing string buffer.
367
373
this ->parse_body (
368
374
request_strand_.wrap (
369
- boost ::bind (
375
+ std ::bind (
370
376
&this_type::handle_received_data,
371
- this_type::shared_from_this () ,
377
+ this ,
372
378
body, get_body, callback,
373
- boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred
379
+ std::placeholders::_1,
380
+ std::placeholders::_2
374
381
)
375
382
),
376
383
remainder);
@@ -428,14 +435,14 @@ struct http_async_connection_pimpl : std::enable_shared_from_this<http_async_con
428
435
this ->part .c_array (),
429
436
this ->part .size ()),
430
437
request_strand_.wrap (
431
- boost ::bind (
438
+ std ::bind (
432
439
&this_type::handle_received_data,
433
- this_type::shared_from_this () ,
440
+ this ,
434
441
body,
435
442
get_body,
436
443
callback,
437
- boost::asio:: placeholders::error ,
438
- boost::asio:: placeholders::bytes_transferred )));
444
+ std:: placeholders::_1 ,
445
+ std:: placeholders::_2 )));
439
446
} else {
440
447
NETWORK_MESSAGE (" no callback provided, appending to body..." );
441
448
bool get_more = true ;
@@ -453,14 +460,14 @@ struct http_async_connection_pimpl : std::enable_shared_from_this<http_async_con
453
460
// that's still in the buffer.
454
461
if (get_more) {
455
462
this ->parse_body (request_strand_.wrap (
456
- boost ::bind (
463
+ std ::bind (
457
464
&this_type::handle_received_data,
458
- this_type::shared_from_this () ,
465
+ this ,
459
466
body,
460
467
get_body,
461
468
callback,
462
- boost::asio:: placeholders::error ,
463
- boost::asio:: placeholders::bytes_transferred )),
469
+ std:: placeholders::_1 ,
470
+ std:: placeholders::_2 )),
464
471
bytes_transferred);
465
472
} else {
466
473
std::string body_string;
0 commit comments