Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-06-30 08:08:44

0001 //
0002 // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
0003 //
0004 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0005 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 //
0007 // Official repository: https://github.com/boostorg/beast
0008 //
0009 
0010 #ifndef BOOST_BEAST_CORE_SSL_STREAM_HPP
0011 #define BOOST_BEAST_CORE_SSL_STREAM_HPP
0012 
0013 #include <boost/beast/core/detail/config.hpp>
0014 
0015 // This include is necessary to work with `ssl::stream` and `boost::beast::websocket::stream`
0016 #include <boost/beast/websocket/ssl.hpp>
0017 
0018 // VFALCO We include this because anyone who uses ssl will
0019 //        very likely need to check for ssl::error::stream_truncated
0020 #include <boost/asio/ssl/error.hpp>
0021 
0022 #include <boost/asio/ssl/stream.hpp>
0023 
0024 namespace boost {
0025 namespace beast {
0026 
0027 /** (Deprecated: Use asio::ssl::stream instead.) Provides stream-oriented functionality using OpenSSL
0028 */
0029 template<class NextLayer>
0030 struct ssl_stream : net::ssl::stream<NextLayer>
0031 {
0032     using net::ssl::stream<NextLayer>::stream;
0033 };
0034 
0035 #if ! BOOST_BEAST_DOXYGEN
0036 template<class SyncStream>
0037 void
0038 teardown(
0039     boost::beast::role_type role,
0040     ssl_stream<SyncStream>& stream,
0041     boost::system::error_code& ec)
0042 {
0043     // Just forward it to the underlying ssl::stream
0044     using boost::beast::websocket::teardown;
0045     teardown(role, static_cast<net::ssl::stream<SyncStream>&>(stream), ec);
0046 }
0047 
0048 template<class AsyncStream,
0049         typename TeardownHandler = net::default_completion_token_t<beast::executor_type<AsyncStream>>>
0050 void
0051 async_teardown(
0052     boost::beast::role_type role,
0053     ssl_stream<AsyncStream>& stream,
0054     TeardownHandler&& handler = net::default_completion_token_t<beast::executor_type<AsyncStream>>{})
0055 {
0056     // Just forward it to the underlying ssl::stream
0057     using boost::beast::websocket::async_teardown;
0058     async_teardown(role, static_cast<net::ssl::stream<AsyncStream>&>(stream),
0059         std::forward<TeardownHandler>(handler));
0060 }
0061 #endif
0062 
0063 } // beast
0064 } // boost
0065 
0066 #endif