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.

103 lines
2.0KB

  1. //
  2. // ssl/impl/error.ipp
  3. // ~~~~~~~~~~~~~~~~~~
  4. //
  5. // Copyright (c) 2003-2019 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. #if (OPENSSL_VERSION_NUMBER < 0x10100000L) && !defined(OPENSSL_IS_BORINGSSL)
  45. const asio::error_category& get_stream_category()
  46. {
  47. return asio::error::get_ssl_category();
  48. }
  49. #else
  50. namespace detail {
  51. class stream_category : public asio::error_category
  52. {
  53. public:
  54. const char* name() const ASIO_ERROR_CATEGORY_NOEXCEPT
  55. {
  56. return "asio.ssl.stream";
  57. }
  58. std::string message(int value) const
  59. {
  60. switch (value)
  61. {
  62. case stream_truncated: return "stream truncated";
  63. case unspecified_system_error: return "unspecified system error";
  64. case unexpected_result: return "unexpected result";
  65. default: return "asio.ssl.stream error";
  66. }
  67. }
  68. };
  69. } // namespace detail
  70. const asio::error_category& get_stream_category()
  71. {
  72. static detail::stream_category instance;
  73. return instance;
  74. }
  75. #endif
  76. } // namespace error
  77. } // namespace ssl
  78. } // namespace asio
  79. #include "asio/detail/pop_options.hpp"
  80. #endif // ASIO_SSL_IMPL_ERROR_IPP