// ssl/detail/stream_core.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
pending_write_.expires_at(neg_infin());
}
+ template <typename Executor>
+ stream_core(SSL* ssl_impl, const Executor& ex)
+ : engine_(ssl_impl),
+ pending_read_(ex),
+ pending_write_(ex),
+ output_buffer_space_(max_tls_record_size),
+ output_buffer_(boost::asio::buffer(output_buffer_space_)),
+ input_buffer_space_(max_tls_record_size),
+ input_buffer_(boost::asio::buffer(input_buffer_space_))
+ {
+ pending_read_.expires_at(neg_infin());
+ pending_write_.expires_at(neg_infin());
+ }
+
#if defined(BOOST_ASIO_HAS_MOVE)
stream_core(stream_core&& other)
: engine_(BOOST_ASIO_MOVE_CAST(engine)(other.engine_)),
{
}
+#if defined(BOOST_ASIO_HAS_MOVE)
+ stream_core& operator=(stream_core&& other)
+ {
+ if (this != &other)
+ {
+ engine_ = BOOST_ASIO_MOVE_CAST(engine)(other.engine_);
+#if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+ pending_read_ =
+ BOOST_ASIO_MOVE_CAST(boost::asio::deadline_timer)(
+ other.pending_read_);
+ pending_write_ =
+ BOOST_ASIO_MOVE_CAST(boost::asio::deadline_timer)(
+ other.pending_write_);
+#else // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+ pending_read_ =
+ BOOST_ASIO_MOVE_CAST(boost::asio::steady_timer)(
+ other.pending_read_);
+ pending_write_ =
+ BOOST_ASIO_MOVE_CAST(boost::asio::steady_timer)(
+ other.pending_write_);
+#endif // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
+ output_buffer_space_ =
+ BOOST_ASIO_MOVE_CAST(std::vector<unsigned char>)(
+ other.output_buffer_space_);
+ output_buffer_ = other.output_buffer_;
+ input_buffer_space_ =
+ BOOST_ASIO_MOVE_CAST(std::vector<unsigned char>)(
+ other.input_buffer_space_);
+ input_buffer_ = other.input_buffer_;
+ input_ = other.input_;
+ other.output_buffer_ = boost::asio::mutable_buffer(0, 0);
+ other.input_buffer_ = boost::asio::mutable_buffer(0, 0);
+ other.input_ = boost::asio::const_buffer(0, 0);
+ }
+ return *this;
+ }
+#endif // defined(BOOST_ASIO_HAS_MOVE)
+
// The SSL engine.
engine engine_;