]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/asio/ssl/detail/stream_core.hpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / boost / asio / ssl / detail / stream_core.hpp
index 88bad7848b6ce8afab11a9659e4d50cb6e596693..d3ba395e687daaafd63e3cb1bcdf12b2590a6704 100644 (file)
@@ -2,7 +2,7 @@
 // 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)
@@ -52,6 +52,20 @@ struct stream_core
     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_)),
@@ -90,6 +104,44 @@ struct stream_core
   {
   }
 
+#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_;