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_READ_OP_HPP
0012 #define BOOST_ASIO_SSL_DETAIL_READ_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 MutableBufferSequence>
0031 class read_op
0032 {
0033 public:
0034 static constexpr const char* tracking_name()
0035 {
0036 return "ssl::stream<>::async_read_some";
0037 }
0038
0039 read_op(const MutableBufferSequence& 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 boost::asio::mutable_buffer buffer =
0049 boost::asio::detail::buffer_sequence_adapter<boost::asio::mutable_buffer,
0050 MutableBufferSequence>::first(buffers_);
0051
0052 return eng.read(buffer, ec, bytes_transferred);
0053 }
0054
0055 template <typename Handler>
0056 void call_handler(Handler& handler,
0057 const boost::system::error_code& ec,
0058 const std::size_t& bytes_transferred) const
0059 {
0060 static_cast<Handler&&>(handler)(ec, bytes_transferred);
0061 }
0062
0063 private:
0064 MutableBufferSequence buffers_;
0065 };
0066
0067 }
0068 }
0069 }
0070 }
0071
0072 #include <boost/asio/detail/pop_options.hpp>
0073
0074 #endif