Don't log error messages when TLS connections are closed

refs #7244
This commit is contained in:
Gunnar Beutner 2014-10-16 13:11:14 +02:00
parent d7fc37b12e
commit f67a11c183
1 changed files with 8 additions and 4 deletions

View File

@ -200,8 +200,10 @@ size_t TlsStream::Read(void *buffer, size_t count)
Close(); Close();
return count - left; return count - left;
default: default:
if (ERR_peek_error() != 0) {
msgbuf << "SSL_read() failed with code " << ERR_peek_error() << ", \"" << ERR_error_string(ERR_peek_error(), errbuf) << "\""; msgbuf << "SSL_read() failed with code " << ERR_peek_error() << ", \"" << ERR_error_string(ERR_peek_error(), errbuf) << "\"";
Log(LogCritical, "TlsStream", msgbuf.str()); Log(LogCritical, "TlsStream", msgbuf.str());
}
BOOST_THROW_EXCEPTION(openssl_error() BOOST_THROW_EXCEPTION(openssl_error()
<< boost::errinfo_api_function("SSL_read") << boost::errinfo_api_function("SSL_read")
@ -260,8 +262,10 @@ void TlsStream::Write(const void *buffer, size_t count)
Close(); Close();
return; return;
default: default:
if (ERR_peek_error() != 0) {
msgbuf << "SSL_write() failed with code " << ERR_peek_error() << ", \"" << ERR_error_string(ERR_peek_error(), errbuf) << "\""; msgbuf << "SSL_write() failed with code " << ERR_peek_error() << ", \"" << ERR_error_string(ERR_peek_error(), errbuf) << "\"";
Log(LogCritical, "TlsStream", msgbuf.str()); Log(LogCritical, "TlsStream", msgbuf.str());
}
BOOST_THROW_EXCEPTION(openssl_error() BOOST_THROW_EXCEPTION(openssl_error()
<< boost::errinfo_api_function("SSL_write") << boost::errinfo_api_function("SSL_write")