Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
1.7KB

  1. //
  2. // ssl/impl/error.ipp
  3. // ~~~~~~~~~~~~~~~~~~
  4. //
  5. // Copyright (c) 2003-2015 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 ASIO_SSL_IMPL_ERROR_IPP
  11. #define ASIO_SSL_IMPL_ERROR_IPP
  12. #if defined(_MSC_VER) && (_MSC_VER >= 1200)
  13. # pragma once
  14. #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
  15. #include "asio/detail/config.hpp"
  16. #include "asio/ssl/error.hpp"
  17. #include "asio/ssl/detail/openssl_init.hpp"
  18. #include "asio/detail/push_options.hpp"
  19. namespace asio {
  20. namespace error {
  21. namespace detail {
  22. class ssl_category : public asio::error_category
  23. {
  24. public:
  25. const char* name() const ASIO_ERROR_CATEGORY_NOEXCEPT
  26. {
  27. return "asio.ssl";
  28. }
  29. std::string message(int value) const
  30. {
  31. const char* s = ::ERR_reason_error_string(value);
  32. return s ? s : "asio.ssl error";
  33. }
  34. };
  35. } // namespace detail
  36. const asio::error_category& get_ssl_category()
  37. {
  38. static detail::ssl_category instance;
  39. return instance;
  40. }
  41. } // namespace error
  42. namespace ssl {
  43. namespace error {
  44. namespace detail {
  45. class stream_category : public asio::error_category
  46. {
  47. public:
  48. const char* name() const ASIO_ERROR_CATEGORY_NOEXCEPT
  49. {
  50. return "asio.ssl.stream";
  51. }
  52. std::string message(int value) const
  53. {
  54. switch (value)
  55. {
  56. case stream_truncated: return "stream truncated";
  57. default: return "asio.ssl.stream error";
  58. }
  59. }
  60. };
  61. } // namespace detail
  62. const asio::error_category& get_stream_category()
  63. {
  64. static detail::stream_category instance;
  65. return instance;
  66. }
  67. } // namespace error
  68. } // namespace ssl
  69. } // namespace asio
  70. #include "asio/detail/pop_options.hpp"
  71. #endif // ASIO_SSL_IMPL_ERROR_IPP