File tree 1 file changed +6
-6
lines changed
boost/network/protocol/http/client/connection
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,8 @@ struct chunk_encoding_parser {
51
51
size_t chunk_size;
52
52
buffer_type buffer;
53
53
54
- void update_chunk_size (char_const_range const &range) {
54
+ template <typename T>
55
+ void update_chunk_size (boost::iterator_range<T> const &range) {
55
56
if (range.empty ()) return ;
56
57
std::stringstream ss;
57
58
ss << std::hex << range;
@@ -61,7 +62,8 @@ struct chunk_encoding_parser {
61
62
chunk_size = (chunk_size << (range.size () * 4 )) | size;
62
63
}
63
64
64
- char_const_range operator ()(char_const_range const &range) {
65
+ template <typename T>
66
+ char_const_range operator ()(boost::iterator_range<T> const &range) {
65
67
auto iter = boost::begin (range);
66
68
auto begin = iter;
67
69
auto pos = boost::begin (buffer);
@@ -485,10 +487,8 @@ struct http_async_connection
485
487
const auto parse_buffer_size = parse_chunk_encoding.buffer .size ();
486
488
for (size_t i = 0 ; i < this ->partial_parsed .size (); i += parse_buffer_size) {
487
489
auto range = parse_chunk_encoding (boost::make_iterator_range (
488
- static_cast <
489
- typename chunk_encoding_parser_type::const_iterator>(this ->partial_parsed .data ()) + i,
490
- static_cast <
491
- typename chunk_encoding_parser_type::const_iterator>(this ->partial_parsed .data ()) +
490
+ this ->partial_parsed .cbegin () + i,
491
+ this ->partial_parsed .cbegin () +
492
492
std::min (i + parse_buffer_size, this ->partial_parsed .size ())));
493
493
body_string.append (boost::begin (range), boost::end (range));
494
494
}
You can’t perform that action at this time.
0 commit comments