diff options
Diffstat (limited to 'platform/src/ssl_stream.cpp')
| -rw-r--r-- | platform/src/ssl_stream.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/platform/src/ssl_stream.cpp b/platform/src/ssl_stream.cpp index 865e623..55f3924 100644 --- a/platform/src/ssl_stream.cpp +++ b/platform/src/ssl_stream.cpp @@ -1083,11 +1083,10 @@ static void ssl_stream_set_cmsg_integer(struct ssl_stream* stream, enum tfe_cmsg return; } -unsigned long ssl_stream_log_error(struct bufferevent * bev, enum tfe_conn_dir dir, struct ssl_mgr* mgr) +unsigned long ssl_stream_log_error(struct bufferevent * bev, enum tfe_conn_dir dir, struct ssl_mgr* mgr, const char *addr) { unsigned long sslerr=0, ret_sslerr=0; int fd=bufferevent_getfd(bev); - char* addr_string=tfe_string_addr_create_by_fd(fd, dir); void* logger=mgr->logger; int fs_id=-1; @@ -1134,7 +1133,7 @@ unsigned long ssl_stream_log_error(struct bufferevent * bev, enum tfe_conn_dir d TFE_LOG_ERROR(logger,"Handshake Error from bufferevent of ssl %s %s: " "%i:%s %lu:%i:%s:%i:%s:%i:%s", tfe_stream_conn_dir_to_str(dir), - addr_string, + addr, errno, errno ? strerror(errno) : "-", sslerr, @@ -1168,7 +1167,7 @@ unsigned long ssl_stream_log_error(struct bufferevent * bev, enum tfe_conn_dir d TFE_LOG_ERROR(logger,"Error from bufferevent of ssl %s %s: " "%i:%s %lu:%i:%s:%i:%s:%i:%s", tfe_stream_conn_dir_to_str(dir), - addr_string, + addr, errno, errno ? strerror(errno) : "-", sslerr, @@ -1196,7 +1195,6 @@ unsigned long ssl_stream_log_error(struct bufferevent * bev, enum tfe_conn_dir d ERR_func_error_string(sslerr)); } } - free(addr_string); return ret_sslerr; } void ssl_stream_process_error(struct ssl_stream * s_stream, unsigned long sslerr, struct ssl_mgr* mgr) @@ -1283,7 +1281,7 @@ static void ssl_server_connected_eventcb(struct bufferevent * bev, short events, if (events & BEV_EVENT_ERROR) { ATOMIC_INC(&(ctx->mgr->stat_val[SSL_UP_ERR])); - sslerr=ssl_stream_log_error(bev, CONN_DIR_UPSTREAM, ctx->mgr); + sslerr=ssl_stream_log_error(bev, CONN_DIR_UPSTREAM, ctx->mgr, s_stream->tcp_stream->str_stream_info); if(sslerr) { ssl_stream_process_error(s_stream, sslerr, mgr); @@ -1898,7 +1896,7 @@ static void ssl_client_connected_eventcb(struct bufferevent * bev, short events, if (events & BEV_EVENT_ERROR) { ATOMIC_INC(&(mgr->stat_val[SSL_DOWN_ERR])); - sslerr=ssl_stream_log_error(bev, CONN_DIR_DOWNSTREAM, mgr); + sslerr=ssl_stream_log_error(bev, CONN_DIR_DOWNSTREAM, mgr, s_stream->tcp_stream->str_stream_info); if(sslerr) { ssl_stream_process_error(s_stream, sslerr, mgr); @@ -2046,7 +2044,7 @@ void ssl_stream_free(struct ssl_stream * s_stream, struct event_base * evbase, s if(errno) { - sslerr=ssl_stream_log_error(bev, s_stream->dir, s_stream->mgr); + sslerr=ssl_stream_log_error(bev, s_stream->dir, s_stream->mgr, s_stream->tcp_stream->str_stream_info); if(sslerr) { ssl_stream_process_error(s_stream, sslerr, s_stream->mgr); |
