@@ -174,14 +174,18 @@ struct async_connection
174
174
public:
175
175
async_connection (asio::io_service& io_service, Handler& handler,
176
176
utils::thread_pool& thread_pool,
177
- boost::shared_ptr<boost::asio::ssl::context > ctx =
178
- boost::shared_ptr<boost::asio::ssl::context >())
177
+ boost::shared_ptr<ssl_context > ctx =
178
+ boost::shared_ptr<ssl_context >())
179
179
: strand(io_service),
180
180
handler (handler),
181
181
thread_pool_(thread_pool),
182
182
headers_buffer(
183
183
BOOST_NETWORK_HTTP_SERVER_CONNECTION_HEADER_BUFFER_MAX_SIZE),
184
+ #ifdef BOOST_NETWORK_ENABLE_HTTPS
184
185
socket_ (io_service, ctx),
186
+ #else
187
+ socket_ (io_service),
188
+ #endif
185
189
handshake_done (false ),
186
190
headers_already_sent(false ),
187
191
headers_in_progress(false ) {
@@ -379,21 +383,25 @@ struct async_connection
379
383
}
380
384
381
385
void read_more (state_t state) {
386
+ #ifdef BOOST_NETWORK_ENABLE_HTTPS
382
387
if (socket_.is_ssl_enabled () && !handshake_done) {
383
388
socket_.async_handshake (
384
389
boost::asio::ssl::stream_base::server,
385
390
boost::bind (&async_connection::handle_handshake,
386
391
async_connection<Tag, Handler>::shared_from_this (),
387
392
boost::asio::placeholders::error, state));
388
393
} else {
394
+ #endif
389
395
socket_.async_read_some (
390
396
asio::buffer (read_buffer_),
391
397
strand.wrap (
392
398
boost::bind (&async_connection<Tag, Handler>::handle_read_data,
393
399
async_connection<Tag, Handler>::shared_from_this (),
394
400
state, boost::asio::placeholders::error,
395
401
boost::asio::placeholders::bytes_transferred)));
402
+ #ifdef BOOST_NETWORK_ENABLE_HTTPS
396
403
}
404
+ #endif
397
405
}
398
406
399
407
void handle_read_data (state_t state, boost::system::error_code const & ec,
0 commit comments