diff --git a/beast/asio/ssl_bundle.h b/beast/asio/ssl_bundle.h index 7f776f0c9..41a4f1e0a 100644 --- a/beast/asio/ssl_bundle.h +++ b/beast/asio/ssl_bundle.h @@ -21,7 +21,9 @@ #define BEAST_ASIO_SSL_BUNDLE_H_INCLUDED #include +#include #include +#include #include namespace beast { @@ -33,21 +35,33 @@ namespace asio { */ struct ssl_bundle { - typedef boost::asio::ip::tcp::socket socket_type; - typedef boost::asio::ssl::stream stream_type; + using socket_type = boost::asio::ip::tcp::socket; + using stream_type = boost::asio::ssl::stream ; + using shared_context = std::shared_ptr; template - ssl_bundle (boost::asio::ssl::context& context, Args&&... args); + ssl_bundle (shared_context const& context_, Args&&... args); + // DEPRECATED + template + ssl_bundle (boost::asio::ssl::context& context_, Args&&... args); + + shared_context context; socket_type socket; stream_type stream; }; template -ssl_bundle::ssl_bundle (boost::asio::ssl::context& context, - Args&&... args) +ssl_bundle::ssl_bundle (shared_context const& context_, Args&&... args) : socket(std::forward(args)...) - , stream (socket, context) + , stream (socket, *context_) +{ +} + +template +ssl_bundle::ssl_bundle (boost::asio::ssl::context& context_, Args&&... args) + : socket(std::forward(args)...) + , stream (socket, context_) { }