Skip to content

Commit 192d520

Browse files
committed
Nicer formatting and clean ups
1 parent ff5c7c8 commit 192d520

File tree

2 files changed

+21
-19
lines changed

2 files changed

+21
-19
lines changed

boost/network/protocol/http/client/connection/async_normal.hpp

+18-16
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
#include <iterator>
1313
#include <cstdint>
14-
#include <iostream>
1514
#include <boost/algorithm/string/trim.hpp>
1615
#include <boost/asio/steady_timer.hpp>
1716
#include <boost/asio/placeholders.hpp>
@@ -48,10 +47,10 @@ struct chunk_encoding_parser {
4847
size_t chunk_size;
4948
std::array<typename char_<Tag>::type, 1024> buffer;
5049

51-
void update_chunk_size(boost::iterator_range<typename std::array<
52-
typename char_<Tag>::type, 1024>::const_iterator> const &range) {
53-
if (range.empty())
54-
return;
50+
void update_chunk_size(
51+
boost::iterator_range<typename std::array<
52+
typename char_<Tag>::type, 1024>::const_iterator> const &range) {
53+
if (range.empty()) return;
5554
std::stringstream ss;
5655
ss << std::hex << range;
5756
size_t size;
@@ -61,15 +60,15 @@ struct chunk_encoding_parser {
6160
}
6261

6362
boost::iterator_range<
64-
typename std::array<typename char_<Tag>::type, 1024>::const_iterator>
65-
operator()(boost::iterator_range<typename std::array<
66-
typename char_<Tag>::type, 1024>::const_iterator> const &range) {
63+
typename std::array<typename char_<Tag>::type, 1024>::const_iterator>
64+
operator()(
65+
boost::iterator_range<typename std::array<
66+
typename char_<Tag>::type, 1024>::const_iterator> const &range) {
6767
auto iter = boost::begin(range);
6868
auto begin = iter;
6969
auto pos = boost::begin(buffer);
7070

71-
while (iter != boost::end(range))
72-
switch (state) {
71+
while (iter != boost::end(range)) switch (state) {
7372
case state_t::header:
7473
iter = std::find(iter, boost::end(range), '\r');
7574
update_chunk_size(boost::make_iterator_range(begin, iter));
@@ -479,19 +478,22 @@ struct http_async_connection
479478
string_type body_string;
480479
if (this->is_chunk_encoding && remove_chunk_markers_) {
481480
for (size_t i = 0; i < this->partial_parsed.size(); i += 1024) {
482-
auto range = parse_chunk_encoding(
483-
boost::make_iterator_range(this->partial_parsed.data() + i,
484-
this->partial_parsed.data() + std::min(i+1024, this->partial_parsed.size())));
481+
auto range = parse_chunk_encoding(boost::make_iterator_range(
482+
this->partial_parsed.data() + i,
483+
this->partial_parsed.data() +
484+
std::min(i + 1024, this->partial_parsed.size())));
485485
body_string.append(boost::begin(range), boost::end(range));
486486
}
487487
this->partial_parsed.clear();
488-
auto range = parse_chunk_encoding(boost::make_iterator_range(this->part.begin(),
489-
this->part.begin() + bytes_transferred));
488+
auto range = parse_chunk_encoding(boost::make_iterator_range(
489+
this->part.begin(),
490+
this->part.begin() + bytes_transferred));
490491
body_string.append(boost::begin(range), boost::end(range));
491492
this->body_promise.set_value(body_string);
492493
} else {
493494
std::swap(body_string, this->partial_parsed);
494-
body_string.append(this->part.begin(), this->part.begin() + bytes_transferred);
495+
body_string.append(this->part.begin(),
496+
this->part.begin() + bytes_transferred);
495497
this->body_promise.set_value(body_string);
496498
}
497499
}

boost/network/protocol/http/policies/async_connection.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ struct async_connection_policy : resolver_policy<Tag>::type {
4747
optional<string_type> const& sni_hostname, long ssl_options) {
4848
pimpl = impl::async_connection_base<Tag, version_major, version_minor>::
4949
new_connection(resolve, resolver, follow_redirect, always_verify_peer,
50-
https, timeout, remove_chunk_markers, certificate_filename,
51-
verify_path, certificate_file, private_key_file, ciphers,
52-
sni_hostname, ssl_options);
50+
https, timeout, remove_chunk_markers,
51+
certificate_filename, verify_path, certificate_file,
52+
private_key_file, ciphers, sni_hostname, ssl_options);
5353
}
5454

5555
basic_response<Tag> send_request(string_type /*unused*/ const& method,

0 commit comments

Comments
 (0)