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

@@ -11,6 +11,7 @@ struct ssl_mgr;
struct ssl_mgr * ssl_manager_init(const char * ini_profile, const char * section, struct event_base * ev_base_gc,
void * logger);
void ssl_manager_destroy(struct ssl_mgr * mgr);
void ssl_stream_log_error(struct bufferevent * bev, enum tfe_conn_dir dir, struct ssl_mgr* mgr);
struct ssl_stream * ssl_upstream_create_result_release_stream(future_result_t * result);
struct bufferevent * ssl_upstream_create_result_release_bev(future_result_t * result);

View File

@@ -74,7 +74,6 @@ static __attribute__((__used__)) const char * tfe_version = "Unknown";
struct tfe_thread_ctx * tfe_proxy_thread_ctx_acquire(struct tfe_proxy * ctx)
{
unsigned int min_thread_id = 0;
unsigned int min_load = 0;
static unsigned int counter=0;
counter++;
/*

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));