@@ -61,6 +61,7 @@ struct http_async_connection
6161typedef typename base::string_type string_type;
6262typedef typename base::request request;
6363typedef typename base::resolver_base::resolve_function resolve_function;
64+ typedef typename base::char_const_range char_const_range;
6465typedef
6566typename base::body_callback_function_type body_callback_function_type;
6667typedef
@@ -128,7 +129,7 @@ struct http_async_connection
128129this ->destination_promise .set_exception (std::make_exception_ptr (error));
129130this ->body_promise .set_exception (std::make_exception_ptr (error));
130131if ( callback )
131- callback (boost::iterator_range< const char *> (), ec );
132+ callback (char_const_range (), ec );
132133this ->timer_ .cancel ();
133134 }
134135
@@ -321,7 +322,7 @@ struct http_async_connection
321322// body (in the case of a HEAD request).
322323this ->body_promise .set_value (" " );
323324if ( callback )
324- callback (boost::iterator_range< const char *> (), boost::asio::error::eof );
325+ callback (char_const_range (), boost::asio::error::eof );
325326this ->destination_promise .set_value (" " );
326327this ->source_promise .set_value (" " );
327328// this->part.assign('\0');
@@ -392,7 +393,9 @@ struct http_async_connection
392393 }else {
393394 string_type body_string;
394395std::swap (body_string,this ->partial_parsed );
395- body_string.append (this ->part .begin (), bytes_transferred);
396+ auto it =this ->part .begin ();
397+ std::advance (it, bytes_transferred);
398+ body_string.append (this ->part .begin (), it);
396399if (this ->is_chunk_encoding ) {
397400this ->body_promise .set_value (parse_chunk_encoding (body_string));
398401 }else {
@@ -468,7 +471,7 @@ struct http_async_connection
468471this ->body_promise .set_exception (std::make_exception_ptr (error));
469472 }
470473else
471- callback (boost::iterator_range< const char *> (), report_code );
474+ callback (char_const_range (), report_code );
472475break ;
473476default :
474477BOOST_ASSERT (false &&" Bug, report this to the developers!" );