Commit 423f372e authored by Dominik Charousset's avatar Dominik Charousset

Move CAF_RAISE_ERROR to its own header

Improve the utility macro by (1) allowing users to specify the exception
type, and (2) always log the exception text as error.
parent 175c195a
......@@ -88,6 +88,7 @@ set(LIBCAF_CORE_SRCS
src/pretty_type_name.cpp
src/private_thread.cpp
src/proxy_registry.cpp
src/raise_error.cpp
src/raw_event_based_actor.cpp
src/ref_counted.cpp
src/replies_to.cpp
......
......@@ -55,10 +55,11 @@
#include "caf/actor_proxy.hpp"
#include "caf/exit_reason.hpp"
#include "caf/local_actor.hpp"
#include "caf/raise_error.hpp"
#include "caf/ref_counted.hpp"
#include "caf/stream_slot.hpp"
#include "caf/thread_hook.hpp"
#include "caf/typed_actor.hpp"
#include "caf/stream_slot.hpp"
#include "caf/actor_system.hpp"
#include "caf/config_value.hpp"
#include "caf/deserializer.hpp"
......
......@@ -22,6 +22,7 @@
#include "caf/buffered_downstream_manager.hpp"
#include "caf/outbound_path.hpp"
#include "caf/raise_error.hpp"
#include "caf/detail/algorithms.hpp"
#include "caf/detail/path_state.hpp"
......
......@@ -259,12 +259,3 @@
__FILE__, __LINE__, error); \
::abort(); \
} while (false)
#ifdef CAF_NO_EXCEPTIONS
# define CAF_RAISE_ERROR(msg) \
CAF_CRITICAL(msg)
#else // CAF_NO_EXCEPTIONS
# define CAF_RAISE_ERROR(msg) \
throw std::runtime_error(msg)
#endif // CAF_NO_EXCEPTIONS
......@@ -30,6 +30,7 @@
#include "caf/dictionary.hpp"
#include "caf/fwd.hpp"
#include "caf/optional.hpp"
#include "caf/raise_error.hpp"
#include "caf/string_algorithms.hpp"
#include "caf/sum_type.hpp"
#include "caf/sum_type_access.hpp"
......
......@@ -23,14 +23,9 @@
#include <utility>
#include <type_traits>
#include "caf/config.hpp"
#ifndef CAF_NO_EXCEPTIONS
#include <exception>
#endif // CAF_NO_EXCEPTIONS
#include "caf/fwd.hpp"
#include "caf/data_processor.hpp"
#include "caf/fwd.hpp"
#include "caf/raise_error.hpp"
namespace caf {
......
......@@ -21,11 +21,11 @@
#include <cstddef>
#include <iterator>
#include <algorithm>
#include <stdexcept>
#include <type_traits>
#include <initializer_list>
#include "caf/config.hpp"
#include "caf/raise_error.hpp"
namespace caf {
namespace detail {
......
......@@ -21,13 +21,11 @@
#include <vector>
#include <algorithm>
#include <stdexcept>
#include <functional>
#include "caf/config.hpp"
#include "caf/detail/comparable.hpp"
#include "caf/detail/type_traits.hpp"
#include "caf/raise_error.hpp"
namespace caf {
namespace detail {
......@@ -231,7 +229,8 @@ public:
mapped_type& at(const K& key) {
auto i = find(key);
if (i == end())
CAF_RAISE_ERROR("caf::detail::unordered_flat_map::at out of range");
CAF_RAISE_ERROR(std::out_of_range,
"caf::detail::unordered_flat_map::at out of range");
return i->second;
}
......
/******************************************************************************
* ____ _ _____ *
* / ___| / \ | ___| C++ *
* | | / _ \ | |_ Actor *
* | |___ / ___ \| _| Framework *
* \____/_/ \_|_| *
* *
* Copyright 2011-2018 Dominik Charousset *
* *
* Distributed under the terms and conditions of the BSD 3-Clause License or *
* (at your option) under the terms and conditions of the Boost Software *
* License 1.0. See accompanying files LICENSE and LICENSE_ALTERNATIVE. *
* *
* If you did not receive a copy of the license files, see *
* http://opensource.org/licenses/BSD-3-Clause and *
* http://www.boost.org/LICENSE_1_0.txt. *
******************************************************************************/
#pragma once
#include "caf/config.hpp"
#ifndef CAF_NO_EXCEPTIONS
#include <stdexcept>
#endif
#include "caf/detail/pp.hpp"
namespace caf {
namespace detail {
void log_cstring_error(const char* cstring);
} // namespace detail
} // namespace caf
#ifdef CAF_NO_EXCEPTIONS
#define CAF_RAISE_ERROR_IMPL_1(msg) \
do { \
::caf::detail::log_cstring_error(msg); \
CAF_CRITICAL(msg); \
} while (false)
#define CAF_RAISE_ERROR_IMPL_2(unused, msg) CAF_RAISE_ERROR_IMPL_1(msg)
#else // CAF_NO_EXCEPTIONS
#define CAF_RAISE_ERROR_IMPL_2(exception_type, msg) \
do { \
::caf::detail::log_cstring_error(msg); \
throw exception_type(msg); \
} while (false)
#define CAF_RAISE_ERROR_IMPL_1(msg) \
CAF_RAISE_ERROR_IMPL_2(std::runtime_error, msg)
#endif // CAF_NO_EXCEPTIONS
#ifdef CAF_MSVC
/// Throws an exception if `CAF_NO_EXCEPTIONS` is undefined, otherwise calls
/// abort() after printing a given message.
#define CAF_RAISE_ERROR(...) \
CAF_PP_CAT(CAF_PP_OVERLOAD(CAF_RAISE_ERROR_IMPL_, __VA_ARGS__)(__VA_ARGS__), \
CAF_PP_EMPTY())
#else // CAF_MSVC
/// Throws an exception if `CAF_NO_EXCEPTIONS` is undefined, otherwise calls
/// abort() after printing a given message.
#define CAF_RAISE_ERROR(...) \
CAF_PP_OVERLOAD(CAF_RAISE_ERROR_IMPL_, __VA_ARGS__)(__VA_ARGS__)
#endif // CAF_MSVC
......@@ -18,19 +18,18 @@
#pragma once
#include "caf/config.hpp"
#include <deque>
#include <chrono>
#include <limits>
#include <cstddef>
#include <algorithm>
#include "caf/config.hpp"
#include "caf/detail/test_actor_clock.hpp"
#include "caf/raise_error.hpp"
#include "caf/scheduled_actor.hpp"
#include "caf/scheduler/abstract_coordinator.hpp"
#include "caf/detail/test_actor_clock.hpp"
namespace caf {
namespace scheduler {
......
......@@ -22,14 +22,9 @@
#include <cstddef> // size_t
#include <type_traits>
#include "caf/config.hpp"
#ifndef CAF_NO_EXCEPTIONS
#include <exception>
#endif // CAF_NO_EXCEPTIONS
#include "caf/fwd.hpp"
#include "caf/data_processor.hpp"
#include "caf/fwd.hpp"
#include "caf/raise_error.hpp"
namespace caf {
......
......@@ -25,6 +25,7 @@
#include "caf/config.hpp"
#include "caf/default_sum_type_access.hpp"
#include "caf/fwd.hpp"
#include "caf/raise_error.hpp"
#include "caf/static_visitor.hpp"
#include "caf/sum_type.hpp"
#include "caf/sum_type_access.hpp"
......
......@@ -20,11 +20,12 @@
#include <unordered_set>
#include "caf/send.hpp"
#include "caf/to_string.hpp"
#include "caf/event_based_actor.hpp"
#include "caf/actor_system_config.hpp"
#include "caf/event_based_actor.hpp"
#include "caf/raise_error.hpp"
#include "caf/raw_event_based_actor.hpp"
#include "caf/send.hpp"
#include "caf/to_string.hpp"
#include "caf/policy/work_sharing.hpp"
#include "caf/policy/work_stealing.hpp"
......
......@@ -16,13 +16,14 @@
* http://www.boost.org/LICENSE_1_0.txt. *
******************************************************************************/
#include "caf/message.hpp"
#include "caf/make_counted.hpp"
#include "caf/detail/concatenated_tuple.hpp"
#include <numeric>
#include "caf/make_counted.hpp"
#include "caf/message.hpp"
#include "caf/raise_error.hpp"
namespace caf {
namespace detail {
......@@ -115,7 +116,7 @@ std::pair<message_data*, size_t> concatenated_tuple::select(size_t pos) const {
else
return {m.get(), idx};
}
CAF_RAISE_ERROR("out of range: concatenated_tuple::select");
CAF_RAISE_ERROR(std::out_of_range, "concatenated_tuple::select out of range");
}
} // namespace detail
......
/******************************************************************************
* ____ _ _____ *
* / ___| / \ | ___| C++ *
* | | / _ \ | |_ Actor *
* | |___ / ___ \| _| Framework *
* \____/_/ \_|_| *
* *
* Copyright 2011-2018 Dominik Charousset *
* *
* Distributed under the terms and conditions of the BSD 3-Clause License or *
* (at your option) under the terms and conditions of the Boost Software *
* License 1.0. See accompanying files LICENSE and LICENSE_ALTERNATIVE. *
* *
* If you did not receive a copy of the license files, see *
* http://opensource.org/licenses/BSD-3-Clause and *
* http://www.boost.org/LICENSE_1_0.txt. *
******************************************************************************/
#include "caf/raise_error.hpp"
#include "caf/logger.hpp"
namespace caf {
namespace detail {
void log_cstring_error(const char* cstring) {
CAF_LOG_ERROR(cstring);
}
} // namespace detail
} // namespace caf
......@@ -24,6 +24,7 @@
#include <stdexcept>
#include "caf/config.hpp"
#include "caf/raise_error.hpp"
namespace {
......@@ -56,7 +57,7 @@ string_view::const_reverse_iterator string_view::crend() const noexcept {
string_view::const_reference string_view::at(size_type pos) const {
if (pos < size_)
return data_[pos];
CAF_RAISE_ERROR("string_view::at out of range");
CAF_RAISE_ERROR(std::out_of_range, "string_view::at out of range");
}
// -- modifiers ----------------------------------------------------------------
......
......@@ -20,9 +20,10 @@
#include <limits>
#include "caf/resumable.hpp"
#include "caf/monitorable_actor.hpp"
#include "caf/actor_system_config.hpp"
#include "caf/monitorable_actor.hpp"
#include "caf/raise_error.hpp"
#include "caf/resumable.hpp"
namespace caf {
namespace scheduler {
......
......@@ -18,8 +18,9 @@
#include "caf/type_erased_tuple.hpp"
#include "caf/error.hpp"
#include "caf/config.hpp"
#include "caf/error.hpp"
#include "caf/raise_error.hpp"
#include "caf/detail/try_match.hpp"
......
......@@ -27,6 +27,7 @@
#include "caf/default_sum_type_access.hpp"
#include "caf/detail/overload.hpp"
#include "caf/raise_error.hpp"
#include "caf/static_visitor.hpp"
#include "caf/sum_type.hpp"
#include "caf/sum_type_access.hpp"
......
......@@ -22,6 +22,7 @@
#include <unordered_map>
#include "caf/logger.hpp"
#include "caf/raise_error.hpp"
#include "caf/ref_counted.hpp"
#include "caf/io/fwd.hpp"
......
......@@ -48,8 +48,8 @@
#include <utility>
#include "caf/detail/get_mac_addresses.hpp"
#include "caf/io/network/ip_endpoint.hpp"
#include "caf/raise_error.hpp"
namespace caf {
namespace io {
......
......@@ -18,11 +18,11 @@
#include "caf/io/network/test_multiplexer.hpp"
#include "caf/scheduler/abstract_coordinator.hpp"
#include "caf/io/scribe.hpp"
#include "caf/io/doorman.hpp"
#include "caf/io/datagram_servant.hpp"
#include "caf/io/doorman.hpp"
#include "caf/io/scribe.hpp"
#include "caf/raise_error.hpp"
#include "caf/scheduler/abstract_coordinator.hpp"
namespace caf {
namespace io {
......
......@@ -26,6 +26,7 @@
#include "caf/all.hpp"
#include "caf/intrusive_ptr.hpp"
#include "caf/raise_error.hpp"
#include "caf/detail/raw_ptr.hpp"
#include "caf/detail/command_helper.hpp"
......@@ -84,20 +85,14 @@ public:
const char* kernel_name, const nd_range& range,
input_mapping map_args, output_mapping map_result,
Ts&&... xs) {
if (range.dimensions().empty()) {
auto str = "OpenCL kernel needs at least 1 global dimension.";
CAF_RAISE_ERROR(str);
}
auto check_vec = [&](const dim_vec& vec, const char* name) {
if (! vec.empty() && vec.size() != range.dimensions().size()) {
std::ostringstream oss;
oss << name << " vector is not empty, but "
<< "its size differs from global dimensions vector's size";
CAF_RAISE_ERROR(oss.str());
}
if (range.dimensions().empty())
CAF_RAISE_ERROR("OpenCL kernel needs at least 1 global dimension");
auto check_vec = [&](const dim_vec& vec) {
if (!vec.empty() && vec.size() != range.dimensions().size())
CAF_RAISE_ERROR("illegal vector size");
};
check_vec(range.offsets(), "offsets");
check_vec(range.local_dimensions(), "local dimensions");
check_vec(range.offsets());
check_vec(range.local_dimensions());
auto& sys = actor_conf.host->system();
auto itr = prog->available_kernels_.find(kernel_name);
if (itr == prog->available_kernels_.end()) {
......
......@@ -24,9 +24,10 @@
#include <algorithm>
#include <functional>
#include "caf/logger.hpp"
#include "caf/actor_cast.hpp"
#include "caf/abstract_actor.hpp"
#include "caf/actor_cast.hpp"
#include "caf/logger.hpp"
#include "caf/raise_error.hpp"
#include "caf/response_promise.hpp"
#include "caf/detail/raw_ptr.hpp"
......@@ -194,7 +195,7 @@ private:
events.data(), &events.back());
if (err != CL_SUCCESS) {
this->deref(); // failed to enqueue command
CAF_RAISE_ERROR("clEnqueueReadBuffer: " + opencl_error(err));
CAF_RAISE_ERROR("failed to enqueue command");
}
pos += 1;
}
......
......@@ -20,6 +20,7 @@
#include <fstream>
#include "caf/detail/type_list.hpp"
#include "caf/raise_error.hpp"
#include "caf/opencl/device.hpp"
#include "caf/opencl/manager.hpp"
......@@ -95,10 +96,7 @@ program_ptr manager::create_program_from_file(const char* path,
static_cast<streamsize>(kernel_source.size()));
read_source.close();
} else {
ostringstream oss;
oss << "No file at '" << path << "' found.";
CAF_LOG_ERROR(CAF_ARG(oss.str()));
CAF_RAISE_ERROR(oss.str());
CAF_RAISE_ERROR("create_program_from_file: path not found");
}
return create_program(kernel_source.c_str(), options, device_id);
}
......@@ -108,10 +106,7 @@ program_ptr manager::create_program(const char* kernel_source,
uint32_t device_id) {
auto dev = find_device(device_id);
if (!dev) {
ostringstream oss;
oss << "No device with id '" << device_id << "' found.";
CAF_LOG_ERROR(CAF_ARG(oss.str()));
CAF_RAISE_ERROR(oss.str());
CAF_RAISE_ERROR("create_program: no device found");
}
return create_program(kernel_source, options, *dev);
}
......@@ -129,10 +124,7 @@ program_ptr manager::create_program_from_file(const char* path,
static_cast<streamsize>(kernel_source.size()));
read_source.close();
} else {
ostringstream oss;
oss << "No file at '" << path << "' found.";
CAF_LOG_ERROR(CAF_ARG(oss.str()));
CAF_RAISE_ERROR(oss.str());
CAF_RAISE_ERROR("create_program_from_file: path not found");
}
return create_program(kernel_source.c_str(), options, dev);
}
......@@ -169,12 +161,12 @@ program_ptr manager::create_program(const char* kernel_source,
// seems that just apple implemented the
// pfn_notify callback, but we can get
// the build log
#ifndef __APPLE__
#ifndef CAF_MACOS
CAF_LOG_ERROR(CAF_ARG(ss.str()));
#endif
oss << endl << ss.str();
}
CAF_RAISE_ERROR(oss.str());
CAF_RAISE_ERROR("clBuildProgram failed");
}
cl_uint number_of_kernels = 0;
clCreateKernelsInProgram(pptr.get(), 0u, nullptr, &number_of_kernels);
......@@ -183,23 +175,16 @@ program_ptr manager::create_program(const char* kernel_source,
vector<cl_kernel> kernels(number_of_kernels);
err = clCreateKernelsInProgram(pptr.get(), number_of_kernels,
kernels.data(), nullptr);
if (err != CL_SUCCESS) {
ostringstream oss;
oss << "clCreateKernelsInProgram: " << opencl_error(err);
CAF_RAISE_ERROR(oss.str());
}
if (err != CL_SUCCESS)
CAF_RAISE_ERROR("clCreateKernelsInProgram failed");
for (cl_uint i = 0; i < number_of_kernels; ++i) {
size_t len;
clGetKernelInfo(kernels[i], CL_KERNEL_FUNCTION_NAME, 0, nullptr, &len);
vector<char> name(len);
err = clGetKernelInfo(kernels[i], CL_KERNEL_FUNCTION_NAME, len,
reinterpret_cast<void*>(name.data()), nullptr);
if (err != CL_SUCCESS) {
ostringstream oss;
oss << "clGetKernelInfo (CL_KERNEL_FUNCTION_NAME): "
<< opencl_error(err);
CAF_RAISE_ERROR(oss.str());
}
if (err != CL_SUCCESS)
CAF_RAISE_ERROR("clGetKernelInfo failed");
detail::raw_kernel_ptr kernel;
kernel.reset(move(kernels[i]));
available_kernels.emplace(string(name.data()), move(kernel));
......
......@@ -17,17 +17,16 @@
* http://www.boost.org/LICENSE_1_0.txt. *
******************************************************************************/
#include "caf/opencl/opencl_err.hpp"
#include "caf/opencl/opencl_err.hpp"
#include "caf/logger.hpp"
namespace caf {
namespace opencl {
void throwcl(const char* fname, cl_int err) {
void throwcl(const char*, cl_int err) {
if (err != CL_SUCCESS) {
std::string errstr = fname;
errstr += ": ";
errstr += opencl_error(err);
CAF_RAISE_ERROR(std::move(errstr));
CAF_RAISE_ERROR("throwcl: unrecoverable OpenCL error");
}
}
......@@ -35,7 +34,7 @@ void CL_CALLBACK pfn_notify(const char* errinfo, const void*, size_t, void*) {
CAF_LOG_ERROR("\n##### Error message via pfn_notify #####\n"
<< errinfo <<
"\n########################################");
static_cast<void>(errinfo); // remove warning
CAF_IGNORE_UNUSED(errinfo);
}
} // namespace opencl
......
......@@ -63,11 +63,8 @@ platform_ptr platform::create(cl_platform_id platform_id,
device_information.push_back(device::create(context, device_id,
start_id++));
}
if (device_information.empty()) {
string errstr = "no devices for the platform found";
CAF_LOG_ERROR(CAF_ARG(errstr));
CAF_RAISE_ERROR(move(errstr));
}
if (device_information.empty())
CAF_RAISE_ERROR("no devices for the platform found");
auto name = platform_info(platform_id, CL_PLATFORM_NAME);
auto vendor = platform_info(platform_id, CL_PLATFORM_VENDOR);
auto version = platform_info(platform_id, CL_PLATFORM_VERSION);
......
......@@ -161,11 +161,13 @@ constexpr const char* kernel_source = R"__(
}
)__";
#ifndef CAF_NO_EXCEPTIONS
constexpr const char* kernel_source_error = R"__(
kernel void missing(global int*) {
size_t semicolon_missing
}
)__";
#endif // CAF_NO_EXCEPTIONS
constexpr const char* kernel_source_compiler_flag = R"__(
kernel void compiler_flag(global const int* restrict input,
......@@ -398,19 +400,15 @@ void test_opencl(actor_system& sys) {
expected2.data(), result.data());
}, others >> wrong_msg
);
#ifndef CAF_NO_EXCEPTIONS
CAF_MESSAGE("Expecting exception (compiling invalid kernel, "
"semicolon is missing).");
try {
/* auto expected_error = */ mngr.create_program(kernel_source_error);
} catch (const exception& exc) {
std::string starts_with("clBuildProgram: CL_BUILD_PROGRAM_FAILURE");
auto cond = (strncmp(exc.what(), starts_with.c_str(),
starts_with.size()) == 0);
CAF_CHECK(cond);
if (!cond)
CAF_ERROR("Wrong exception cought for program build failure.");
CAF_MESSAGE("got: " << exc.what());
}
#endif // CAF_NO_EXCEPTIONS
// create program with opencl compiler flags
auto prog5 = mngr.create_program(kernel_source_compiler_flag, compiler_flag);
opencl::nd_range range5{dims{array_size}};
......
......@@ -65,7 +65,6 @@ private:
size_t len, const char* debug_name);
SSL_CTX* create_ssl_context();
std::string get_ssl_error();
void raise_ssl_error(std::string msg);
bool handle_ssl_result(int ret);
actor_system& sys_;
......
......@@ -26,11 +26,12 @@ CAF_POP_WARNINGS
#include <vector>
#include <mutex>
#include "caf/expected.hpp"
#include "caf/actor_system.hpp"
#include "caf/scoped_actor.hpp"
#include "caf/actor_control_block.hpp"
#include "caf/actor_system.hpp"
#include "caf/actor_system_config.hpp"
#include "caf/expected.hpp"
#include "caf/raise_error.hpp"
#include "caf/scoped_actor.hpp"
#include "caf/io/middleman.hpp"
#include "caf/io/basp_broker.hpp"
......
......@@ -209,7 +209,7 @@ SSL_CTX* session::create_ssl_context() {
auto ctx = SSL_CTX_new(TLSv1_2_method());
#endif
if (!ctx)
raise_ssl_error("cannot create OpenSSL context");
CAF_RAISE_ERROR("cannot create OpenSSL context");
if (sys_.openssl_manager().authentication_enabled()) {
// Require valid certificates on both sides.
auto& cfg = sys_.config();
......@@ -217,7 +217,7 @@ SSL_CTX* session::create_ssl_context() {
&& SSL_CTX_use_certificate_chain_file(ctx,
cfg.openssl_certificate.c_str())
!= 1)
raise_ssl_error("cannot load certificate");
CAF_RAISE_ERROR("cannot load certificate");
if (cfg.openssl_passphrase.size() > 0) {
openssl_passphrase_ = cfg.openssl_passphrase;
SSL_CTX_set_default_passwd_cb(ctx, pem_passwd_cb);
......@@ -227,19 +227,19 @@ SSL_CTX* session::create_ssl_context() {
&& SSL_CTX_use_PrivateKey_file(ctx, cfg.openssl_key.c_str(),
SSL_FILETYPE_PEM)
!= 1)
raise_ssl_error("cannot load private key");
CAF_RAISE_ERROR("cannot load private key");
auto cafile =
(cfg.openssl_cafile.size() > 0 ? cfg.openssl_cafile.c_str() : nullptr);
auto capath =
(cfg.openssl_capath.size() > 0 ? cfg.openssl_capath.c_str() : nullptr);
if (cafile || capath) {
if (SSL_CTX_load_verify_locations(ctx, cafile, capath) != 1)
raise_ssl_error("cannot load trusted CA certificates");
CAF_RAISE_ERROR("cannot load trusted CA certificates");
}
SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT,
nullptr);
if (SSL_CTX_set_cipher_list(ctx, "HIGH:!aNULL:!MD5") != 1)
raise_ssl_error("cannot set cipher list");
CAF_RAISE_ERROR("cannot set cipher list");
} else {
// No authentication.
SSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, nullptr);
......@@ -248,7 +248,7 @@ SSL_CTX* session::create_ssl_context() {
#else
auto ecdh = EC_KEY_new_by_curve_name(NID_secp384r1);
if (!ecdh)
raise_ssl_error("cannot get ECDH curve");
CAF_RAISE_ERROR("cannot get ECDH curve");
CAF_PUSH_WARNINGS
SSL_CTX_set_tmp_ecdh(ctx, ecdh);
EC_KEY_free(ecdh);
......@@ -260,7 +260,7 @@ SSL_CTX* session::create_ssl_context() {
const char* cipher = "AECDH-AES256-SHA";
#endif
if (SSL_CTX_set_cipher_list(ctx, cipher) != 1)
raise_ssl_error("cannot set anonymous cipher");
CAF_RAISE_ERROR("cannot set anonymous cipher");
}
return ctx;
}
......@@ -277,10 +277,6 @@ std::string session::get_ssl_error() {
return msg;
}
void session::raise_ssl_error(std::string msg) {
CAF_RAISE_ERROR(std::string("[OpenSSL] ") + msg + ": " + get_ssl_error());
}
bool session::handle_ssl_result(int ret) {
auto err = SSL_get_error(ssl_, ret);
switch (err) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment