/Src/Dependencies/Boost/boost/asio/ssl/detail/stream_core.hpp

http://hadesmem.googlecode.com/ · C++ Header · 88 lines · 50 code · 21 blank · 17 comment · 1 complexity · ceecef944e2b3f22e1c0a4f5bfdf9854 MD5 · raw file

  1. //
  2. // ssl/detail/stream_core.hpp
  3. // ~~~~~~~~~~~~~~~~~~~~~~~~~~
  4. //
  5. // Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  6. //
  7. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  8. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  9. //
  10. #ifndef BOOST_ASIO_SSL_DETAIL_STREAM_CORE_HPP
  11. #define BOOST_ASIO_SSL_DETAIL_STREAM_CORE_HPP
  12. #if defined(_MSC_VER) && (_MSC_VER >= 1200)
  13. # pragma once
  14. #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
  15. #include <boost/asio/detail/config.hpp>
  16. #if !defined(BOOST_ASIO_ENABLE_OLD_SSL)
  17. # include <boost/asio/deadline_timer.hpp>
  18. # include <boost/asio/ssl/detail/engine.hpp>
  19. # include <boost/asio/buffer.hpp>
  20. #endif // !defined(BOOST_ASIO_ENABLE_OLD_SSL)
  21. #include <boost/asio/detail/push_options.hpp>
  22. namespace boost {
  23. namespace asio {
  24. namespace ssl {
  25. namespace detail {
  26. #if !defined(BOOST_ASIO_ENABLE_OLD_SSL)
  27. struct stream_core
  28. {
  29. stream_core(SSL_CTX* context, boost::asio::io_service& io_service)
  30. : engine_(context),
  31. pending_read_(io_service),
  32. pending_write_(io_service),
  33. output_buffer_space_(16384),
  34. output_buffer_(boost::asio::buffer(output_buffer_space_)),
  35. input_buffer_space_(16384),
  36. input_buffer_(boost::asio::buffer(input_buffer_space_))
  37. {
  38. pending_read_.expires_at(boost::posix_time::neg_infin);
  39. pending_write_.expires_at(boost::posix_time::neg_infin);
  40. }
  41. ~stream_core()
  42. {
  43. }
  44. // The SSL engine.
  45. engine engine_;
  46. // Timer used for storing queued read operations.
  47. boost::asio::deadline_timer pending_read_;
  48. // Timer used for storing queued write operations.
  49. boost::asio::deadline_timer pending_write_;
  50. // Buffer space used to prepare output intended for the transport.
  51. std::vector<unsigned char> output_buffer_space_;
  52. // A buffer that may be used to prepare output intended for the transport.
  53. const boost::asio::mutable_buffers_1 output_buffer_;
  54. // Buffer space used to read input intended for the engine.
  55. std::vector<unsigned char> input_buffer_space_;
  56. // A buffer that may be used to read input intended for the engine.
  57. const boost::asio::mutable_buffers_1 input_buffer_;
  58. // The buffer pointing to the engine's unconsumed input.
  59. boost::asio::const_buffer input_;
  60. };
  61. #endif // !defined(BOOST_ASIO_ENABLE_OLD_SSL)
  62. } // namespace detail
  63. } // namespace ssl
  64. } // namespace asio
  65. } // namespace boost
  66. #include <boost/asio/detail/pop_options.hpp>
  67. #endif // BOOST_ASIO_SSL_DETAIL_STREAM_CORE_HPP