修复ssl session缓存中对openssl的不正确使用。
This commit is contained in:
@@ -683,10 +683,10 @@ struct bufferevent * ssl_upstream_create_result_release_bev(future_result_t * re
|
||||
ctx->bev = NULL; //giveup ownership
|
||||
return ret;
|
||||
}
|
||||
void ssl_handle_conn_origin_err(struct bufferevent * bev, void* logger)
|
||||
void ssl_stream_log_error(struct bufferevent * bev, enum tfe_conn_dir dir, void* logger)
|
||||
{
|
||||
unsigned long sslerr=0;
|
||||
|
||||
const char* dir_str=(dir==CONN_DIR_DOWNSTREAM?"downstream":"upstream");
|
||||
/* Can happen for socket errs, ssl errs;
|
||||
* may happen for unclean ssl socket shutdowns. */
|
||||
sslerr = bufferevent_get_openssl_error(bev);
|
||||
@@ -703,8 +703,9 @@ void ssl_handle_conn_origin_err(struct bufferevent * bev, void* logger)
|
||||
{
|
||||
/* these can happen due to client cert auth,
|
||||
* only log error if debugging is activated */
|
||||
TFE_LOG_ERROR(logger,"Error from upstream bufferevent: "
|
||||
TFE_LOG_ERROR(logger,"Handshake Error from %s bufferevent: "
|
||||
"%i:%s %lu:%i:%s:%i:%s:%i:%s\n",
|
||||
dir_str,
|
||||
errno,
|
||||
errno ? strerror(errno) : "-",
|
||||
sslerr,
|
||||
@@ -733,8 +734,9 @@ void ssl_handle_conn_origin_err(struct bufferevent * bev, void* logger)
|
||||
else
|
||||
{
|
||||
/* real errors */
|
||||
TFE_LOG_ERROR(logger,"Error from upstream bufferevent: "
|
||||
TFE_LOG_ERROR(logger,"Error from %s bufferevent: "
|
||||
"%i:%s %lu:%i:%s:%i:%s:%i:%s\n",
|
||||
dir_str,
|
||||
errno,
|
||||
errno ? strerror(errno) : "-",
|
||||
sslerr,
|
||||
@@ -778,7 +780,7 @@ static void ssl_connect_origin_eventcb(struct bufferevent * bev, short events, v
|
||||
if (events & BEV_EVENT_ERROR)
|
||||
{
|
||||
ATOMIC_INC(&(ctx->mgr->stat_val[SSL_UP_ERR]));
|
||||
ssl_handle_conn_origin_err(bev,ctx->mgr->logger);
|
||||
ssl_stream_log_error(bev, CONN_DIR_UPSTREAM, ctx->mgr->logger);
|
||||
promise_failed(promise, FUTURE_ERROR_EXCEPTION, "connect to original server failed.");
|
||||
}
|
||||
else if(events & BEV_EVENT_EOF)
|
||||
|
||||
Reference in New Issue
Block a user