File indexing completed on 2025-01-18 09:29:01
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef BOOST_ASIO_SSL_DETAIL_WRITE_OP_HPP
0012 #define BOOST_ASIO_SSL_DETAIL_WRITE_OP_HPP
0013
0014 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
0015 # pragma once
0016 #endif
0017
0018 #include <boost/asio/detail/config.hpp>
0019
0020 #include <boost/asio/detail/buffer_sequence_adapter.hpp>
0021 #include <boost/asio/ssl/detail/engine.hpp>
0022
0023 #include <boost/asio/detail/push_options.hpp>
0024
0025 namespace boost {
0026 namespace asio {
0027 namespace ssl {
0028 namespace detail {
0029
0030 template <typename ConstBufferSequence>
0031 class write_op
0032 {
0033 public:
0034 static constexpr const char* tracking_name()
0035 {
0036 return "ssl::stream<>::async_write_some";
0037 }
0038
0039 write_op(const ConstBufferSequence& buffers)
0040 : buffers_(buffers)
0041 {
0042 }
0043
0044 engine::want operator()(engine& eng,
0045 boost::system::error_code& ec,
0046 std::size_t& bytes_transferred) const
0047 {
0048 unsigned char storage[
0049 boost::asio::detail::buffer_sequence_adapter<boost::asio::const_buffer,
0050 ConstBufferSequence>::linearisation_storage_size];
0051
0052 boost::asio::const_buffer buffer =
0053 boost::asio::detail::buffer_sequence_adapter<boost::asio::const_buffer,
0054 ConstBufferSequence>::linearise(buffers_, boost::asio::buffer(storage));
0055
0056 return eng.write(buffer, ec, bytes_transferred);
0057 }
0058
0059 template <typename Handler>
0060 void call_handler(Handler& handler,
0061 const boost::system::error_code& ec,
0062 const std::size_t& bytes_transferred) const
0063 {
0064 static_cast<Handler&&>(handler)(ec, bytes_transferred);
0065 }
0066
0067 private:
0068 ConstBufferSequence buffers_;
0069 };
0070
0071 }
0072 }
0073 }
0074 }
0075
0076 #include <boost/asio/detail/pop_options.hpp>
0077
0078 #endif