tcp stream使用ssl stream提供的函数输出ssl错误日志。

This commit is contained in:
zhengchao
2019-02-26 19:47:16 +06:00
parent 05c550e46b
commit f349d1254f
3 changed files with 4 additions and 11 deletions

View File

@@ -730,18 +730,11 @@ static void __stream_bev_eventcb(struct bufferevent * bev, short events, void *
if(events & BEV_EVENT_ERROR)
{
unsigned long err;
while ((err = (bufferevent_get_openssl_error(bev))))
if(_stream->session_type==STREAM_PROTO_SSL)
{
const char *msg = (const char*)ERR_reason_error_string(err);
const char *lib = (const char*)ERR_lib_error_string(err);
const char *func = (const char*)ERR_func_error_string(err);
TFE_LOG_INFO(g_default_logger, "%s %s connection error, bufferevent_get_openssl_error() = %lu: %s %s %s",
_stream->str_stream_addr, str_conn_dir, err, lib, func, msg);
ssl_stream_log_error(bev, __bev_dir(_stream, bev), _stream->ssl_mgr);
}
if (errno)
else if(errno)
{
TFE_LOG_INFO(g_default_logger, "%s %s connection error, errno = %d, %s",
_stream->str_stream_addr, str_conn_dir, errno, strerror(errno));