// ssl/detail/impl/engine.ipp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
{
ec = boost::system::error_code(sys_error,
boost::asio::error::get_ssl_category());
- return want_nothing;
+ return pending_output_after > pending_output_before
+ ? want_output : want_nothing;
}
if (ssl_error == SSL_ERROR_SYSCALL)
{
- ec = boost::system::error_code(sys_error,
- boost::asio::error::get_system_category());
- return want_nothing;
+ if (sys_error == 0)
+ {
+ ec = boost::asio::ssl::error::unspecified_system_error;
+ }
+ else
+ {
+ ec = boost::system::error_code(sys_error,
+ boost::asio::error::get_ssl_category());
+ }
+ return pending_output_after > pending_output_before
+ ? want_output : want_nothing;
}
if (result > 0 && bytes_transferred)
ec = boost::system::error_code();
return want_input_and_retry;
}
- else if (::SSL_get_shutdown(ssl_) & SSL_RECEIVED_SHUTDOWN)
+ else if (ssl_error == SSL_ERROR_ZERO_RETURN)
{
ec = boost::asio::error::eof;
return want_nothing;
}
- else
+ else if (ssl_error == SSL_ERROR_NONE)
{
ec = boost::system::error_code();
return want_nothing;
}
+ else
+ {
+ ec = boost::asio::ssl::error::unexpected_result;
+ return want_nothing;
+ }
}
int engine::do_accept(void*, std::size_t)