From 29497f7920e8c171bdce076718513c2b062961c0 Mon Sep 17 00:00:00 2001 From: redfish Date: Mon, 16 Oct 2017 02:41:32 +0000 Subject: epee: use boost type for SSL error code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes compile error when building with OpenSSL v1.1: contrib/epee/include/net/net_helper.h: In member function ‘void epee::net_utils::blocked_mode_client::shutdown_ssl()’: contrib/epee/include/net/net_helper.h:579:106: error: ‘SSL_R_SHORT_READ’ was not declared in this scope if (ec.category() == boost::asio::error::get_ssl_category() && ec.value() != ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SHORT_READ)) ^ contrib/epee/include/net/net_helper.h:579:106: note: suggested alternative: ‘SSL_F_SSL_READ’ See boost/asio/ssl/error.hpp. Boost handles differences between OpenSSL versions. cmake: fail if Boost is too old for OpenSSL v1.1 --- contrib/epee/include/net/net_helper.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'contrib') diff --git a/contrib/epee/include/net/net_helper.h b/contrib/epee/include/net/net_helper.h index c8e4c7818..e0d80f964 100644 --- a/contrib/epee/include/net/net_helper.h +++ b/contrib/epee/include/net/net_helper.h @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -576,7 +577,14 @@ namespace net_utils m_io_service.run_one(); } // Ignore "short read" error - if (ec.category() == boost::asio::error::get_ssl_category() && ec.value() != ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SHORT_READ)) + if (ec.category() == boost::asio::error::get_ssl_category() && + ec.value() != +#if BOOST_VERSION >= 106200 + boost::asio::ssl::error::stream_truncated +#else // older Boost supports only OpenSSL 1.0, so 1.0-only macros are appropriate + ERR_PACK(ERR_LIB_SSL, 0, SSL_R_SHORT_READ) +#endif + ) MDEBUG("Problems at ssl shutdown: " << ec.message()); } -- cgit v1.2.3