@@ -39,8 +39,8 @@ struct sync_connection_base_impl {
39
39
40
40
template <class Socket >
41
41
void init_socket (Socket& socket_, resolver_type& resolver_,
42
- string_type /* unused*/ const & hostname, string_type const & port ,
43
- resolver_function_type resolve_) {
42
+ string_type /* unused*/ const & hostname ,
43
+ string_type const & port, resolver_function_type resolve_) {
44
44
using asio::ip::tcp;
45
45
std::error_code error = asio::error::host_not_found;
46
46
typename resolver_type::iterator endpoint_iterator, end;
@@ -100,7 +100,7 @@ struct sync_connection_base_impl {
100
100
}
101
101
102
102
template <class Socket >
103
- void send_request_impl (Socket& socket_, string_type /* unused*/ const & method,
103
+ void send_request_impl (Socket& socket_, string_type /* unused*/ const & method,
104
104
asio::streambuf& request_buffer) {
105
105
// TODO(dberris): review parameter necessity.
106
106
(void )method;
@@ -118,8 +118,8 @@ struct sync_connection_base_impl {
118
118
std::error_code error;
119
119
if (response_buffer.size () > 0 ) body_stream << &response_buffer;
120
120
121
- while (asio::read (socket_, response_buffer,
122
- asio::transfer_at_least ( 1 ), error)) {
121
+ while (asio::read (socket_, response_buffer, asio::transfer_at_least ( 1 ),
122
+ error)) {
123
123
body_stream << &response_buffer;
124
124
}
125
125
}
@@ -171,8 +171,7 @@ struct sync_connection_base_impl {
171
171
read (socket_, response_buffer,
172
172
asio::transfer_at_least (bytes_to_read), error);
173
173
if (chunk_bytes_read == 0 ) {
174
- if (error != asio::error::eof)
175
- throw std::system_error (error);
174
+ if (error != asio::error::eof) throw std::system_error (error);
176
175
stopping_inner = true ;
177
176
}
178
177
}
@@ -195,14 +194,14 @@ struct sync_connection_base_impl {
195
194
} else {
196
195
size_t already_read = response_buffer.size ();
197
196
if (already_read) body_stream << &response_buffer;
198
- size_t length = std::stoul (std::begin (content_length_range)->second ) -
199
- already_read;
200
- if (length == 0 ) { return ;
201
- }
197
+ size_t length =
198
+ std::stoul (std::begin (content_length_range)->second ) - already_read;
199
+ if (length == 0 ) {
200
+ return ;
201
+ }
202
202
size_t bytes_read = 0 ;
203
203
while ((bytes_read = asio::read (socket_, response_buffer,
204
- asio::transfer_at_least (1 ),
205
- error))) {
204
+ asio::transfer_at_least (1 ), error))) {
206
205
body_stream << &response_buffer;
207
206
length -= bytes_read;
208
207
if ((length <= 0 ) || error) break ;
@@ -223,7 +222,7 @@ struct sync_connection_base_impl {
223
222
} else {
224
223
read_body_transfer_chunk_encoding (socket_, response_, response_buffer,
225
224
body_stream);
226
- }
225
+ }
227
226
} else {
228
227
throw std::runtime_error (" Unsupported HTTP version number." );
229
228
}
@@ -249,14 +248,15 @@ struct sync_connection_base {
249
248
new_connection (
250
249
resolver_type& resolver, resolver_function_type resolve, bool https,
251
250
bool always_verify_peer, int timeout,
252
- optional<string_type> /* unused*/ const & certificate_filename =
251
+ optional<string_type> /* unused*/ const & certificate_filename =
253
252
optional<string_type>(),
254
253
optional<string_type> const & verify_path = optional<string_type>(),
255
254
optional<string_type> const & certificate_file =
256
255
optional<string_type>(),
257
256
optional<string_type> const & private_key_file =
258
257
optional<string_type>(),
259
258
optional<string_type> const & ciphers = optional<string_type>(),
259
+ optional<string_type> const & sni_hostname = optional<string_type>(),
260
260
long ssl_options = 0 ) {
261
261
if (https) {
262
262
#ifdef BOOST_NETWORK_ENABLE_HTTPS
@@ -265,7 +265,7 @@ struct sync_connection_base {
265
265
new https_sync_connection<Tag, version_major, version_minor>(
266
266
resolver, resolve, always_verify_peer, timeout,
267
267
certificate_filename, verify_path, certificate_file,
268
- private_key_file, ciphers, ssl_options));
268
+ private_key_file, ciphers, sni_hostname, ssl_options));
269
269
#else
270
270
throw std::runtime_error (" HTTPS not supported." );
271
271
#endif
0 commit comments