diff --git a/src/protocol/SSLWrapper.cc b/src/protocol/SSLWrapper.cc index 977eb107..6c29be5a 100644 --- a/src/protocol/SSLWrapper.cc +++ b/src/protocol/SSLWrapper.cc @@ -203,16 +203,13 @@ int SSLWrapper::append_message() } while (nleft > 0); } - if (ret < 0) + ret = SSL_get_error(this->ssl, ret); + if (ret != SSL_ERROR_WANT_READ) { - ret = SSL_get_error(this->ssl, ret); - if (ret != SSL_ERROR_WANT_READ) - { - if (ret != SSL_ERROR_SYSCALL) - errno = -ret; + if (ret != SSL_ERROR_SYSCALL) + errno = -ret; - return -1; - } + return -1; } return 0;