Make asio::connection::xxx_socket::translate_ec() methods static

These methods don't need any object to operate on, so make them static to
allow calling them without an actual connection object at hand.
This commit is contained in:
Vadim Zeitlin committed 2017-06-04 01:56:59 +02:00
1 parent 37ce8abc77
commit e6e14df950
2 files changed
+6 -2

No files matched your search

+3 -1
View File
@@ -280,11 +280,13 @@ protected:
* @return The translated error code
*/
template <typename ErrorCodeType>
static
lib::error_code translate_ec(ErrorCodeType) {
// We don't know any more information about this error so pass through
return make_error_code(transport::error::pass_through);
}
static
/// Overload of translate_ec to catch cases where lib::error_code is the
/// same type as lib::asio::error_code
lib::error_code translate_ec(lib::error_code ec) {
+3 -1
View File
@@ -353,6 +353,7 @@ protected:
* @return The translated error code
*/
template <typename ErrorCodeType>
static
lib::error_code translate_ec(ErrorCodeType ec) {
if (ec.category() == lib::asio::error::get_ssl_category()) {
if (ERR_GET_REASON(ec.value()) == SSL_R_SHORT_READ) {
@@ -368,7 +369,8 @@ protected:
return make_error_code(transport::error::pass_through);
}
}
static
/// Overload of translate_ec to catch cases where lib::error_code is the
/// same type as lib::asio::error_code
lib::error_code translate_ec(lib::error_code ec) {