From 0fc70f9f689d5345287c15d6360143355058ec66 Mon Sep 17 00:00:00 2001 From: kone Date: Wed, 2 May 2018 16:25:52 +0800 Subject: [PATCH] 80 limit --- ...gx_http_lua_balancer_ssl_session_fetchby.c | 16 ++++++++++------ ...gx_http_lua_balancer_ssl_session_fetchby.h | 19 ++++++++++--------- ...gx_http_lua_balancer_ssl_session_storeby.c | 19 ++++++++++++------- ...gx_http_lua_balancer_ssl_session_storeby.h | 19 ++++++++++--------- 4 files changed, 42 insertions(+), 31 deletions(-) diff --git a/src/ngx_http_lua_balancer_ssl_session_fetchby.c b/src/ngx_http_lua_balancer_ssl_session_fetchby.c index 26faaf8301..32ac115322 100644 --- a/src/ngx_http_lua_balancer_ssl_session_fetchby.c +++ b/src/ngx_http_lua_balancer_ssl_session_fetchby.c @@ -73,7 +73,8 @@ ngx_http_lua_balancer_ssl_sess_fetch(ngx_peer_connection_t *pc, void *data) ngx_http_lua_srv_conf_t *lscf; ngx_http_lua_balancer_peer_data_t *bp = data; - ngx_log_debug0(NGX_LOG_DEBUG_HTTP, pc->log, 0, "balancer ssl session fetch"); + ngx_log_debug0(NGX_LOG_DEBUG_HTTP, pc->log, 0, + "balancer ssl session fetch"); lscf = bp->conf; @@ -128,8 +129,8 @@ ngx_http_lua_balancer_ssl_sess_fetch(ngx_peer_connection_t *pc, void *data) char * -ngx_http_lua_balancer_ssl_sess_fetch_by_lua_block(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf) +ngx_http_lua_balancer_ssl_sess_fetch_by_lua_block(ngx_conf_t *cf, + ngx_command_t *cmd, void *conf) { char *rv; ngx_conf_t save; @@ -168,7 +169,8 @@ ngx_http_lua_balancer_ssl_sess_fetch_by_lua(ngx_conf_t *cf, ngx_command_t *cmd, value = cf->args->elts; - lscf->balancer.ssl_sess_fetch_handler = (ngx_http_lua_srv_conf_handler_pt) cmd->post; + lscf->balancer.ssl_sess_fetch_handler = + (ngx_http_lua_srv_conf_handler_pt) cmd->post; if (cmd->post == ngx_http_lua_balancer_ssl_sess_fetch_handler_file) { /* Lua code in an external file */ @@ -215,7 +217,8 @@ ngx_http_lua_balancer_ssl_sess_fetch_by_lua(ngx_conf_t *cf, ngx_command_t *cmd, static ngx_int_t -ngx_http_lua_balancer_ssl_sess_fetch_by_chunk(lua_State *L, ngx_http_request_t *r) +ngx_http_lua_balancer_ssl_sess_fetch_by_chunk(lua_State *L, + ngx_http_request_t *r) { u_char *err_msg; size_t len; @@ -254,7 +257,8 @@ ngx_http_lua_balancer_ssl_sess_fetch_by_chunk(lua_State *L, ngx_http_request_t * } ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "failed to run balancer_ssl_session_fetch_by_lua*: %*s", len, err_msg); + "failed to run balancer_ssl_session_fetch_by_lua*: %*s", + len, err_msg); lua_settop(L, 0); /* clear remaining elems on stack */ diff --git a/src/ngx_http_lua_balancer_ssl_session_fetchby.h b/src/ngx_http_lua_balancer_ssl_session_fetchby.h index cbed1acb6b..9ebbe97483 100644 --- a/src/ngx_http_lua_balancer_ssl_session_fetchby.h +++ b/src/ngx_http_lua_balancer_ssl_session_fetchby.h @@ -10,18 +10,19 @@ #include "ngx_http_lua_common.h" -ngx_int_t ngx_http_lua_balancer_ssl_sess_fetch(ngx_peer_connection_t *pc, void *data); +ngx_int_t ngx_http_lua_balancer_ssl_sess_fetch(ngx_peer_connection_t *pc, + void *data); -ngx_int_t ngx_http_lua_balancer_ssl_sess_fetch_handler_inline(ngx_http_request_t *r, - ngx_http_lua_srv_conf_t *lscf, lua_State *L); +ngx_int_t ngx_http_lua_balancer_ssl_sess_fetch_handler_inline( + ngx_http_request_t *r, ngx_http_lua_srv_conf_t *lscf, lua_State *L); -ngx_int_t ngx_http_lua_balancer_ssl_sess_fetch_handler_file(ngx_http_request_t *r, - ngx_http_lua_srv_conf_t *lscf, lua_State *L); +ngx_int_t ngx_http_lua_balancer_ssl_sess_fetch_handler_file( + ngx_http_request_t *r, ngx_http_lua_srv_conf_t *lscf, lua_State *L); -char *ngx_http_lua_balancer_ssl_sess_fetch_by_lua(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf); +char *ngx_http_lua_balancer_ssl_sess_fetch_by_lua(ngx_conf_t *cf, + ngx_command_t *cmd, void *conf); -char *ngx_http_lua_balancer_ssl_sess_fetch_by_lua_block(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf); +char *ngx_http_lua_balancer_ssl_sess_fetch_by_lua_block(ngx_conf_t *cf, + ngx_command_t *cmd, void *conf); #endif /* _NGX_HTTP_LUA_BALANCER_SSL_SESSION_FETCHBY_H_INCLUDED_ */ diff --git a/src/ngx_http_lua_balancer_ssl_session_storeby.c b/src/ngx_http_lua_balancer_ssl_session_storeby.c index d99c62f0c9..a78c3f4dc3 100644 --- a/src/ngx_http_lua_balancer_ssl_session_storeby.c +++ b/src/ngx_http_lua_balancer_ssl_session_storeby.c @@ -74,7 +74,8 @@ ngx_http_lua_balancer_ssl_sess_store(ngx_peer_connection_t *pc, void *data) ngx_http_lua_srv_conf_t *lscf; ngx_http_lua_balancer_peer_data_t *bp = data; - ngx_log_debug0(NGX_LOG_DEBUG_HTTP, pc->log, 0, "balancer ssl session store"); + ngx_log_debug0(NGX_LOG_DEBUG_HTTP, pc->log, 0, + "balancer ssl session store"); lscf = bp->conf; @@ -129,8 +130,8 @@ ngx_http_lua_balancer_ssl_sess_store(ngx_peer_connection_t *pc, void *data) char * -ngx_http_lua_balancer_ssl_sess_store_by_lua_block(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf) +ngx_http_lua_balancer_ssl_sess_store_by_lua_block(ngx_conf_t *cf, + ngx_command_t *cmd, void *conf) { char *rv; ngx_conf_t save; @@ -169,7 +170,8 @@ ngx_http_lua_balancer_ssl_sess_store_by_lua(ngx_conf_t *cf, ngx_command_t *cmd, value = cf->args->elts; - lscf->balancer.ssl_sess_store_handler = (ngx_http_lua_srv_conf_handler_pt) cmd->post; + lscf->balancer.ssl_sess_store_handler = + (ngx_http_lua_srv_conf_handler_pt) cmd->post; if (cmd->post == ngx_http_lua_balancer_ssl_sess_store_handler_file) { /* Lua code in an external file */ @@ -216,7 +218,8 @@ ngx_http_lua_balancer_ssl_sess_store_by_lua(ngx_conf_t *cf, ngx_command_t *cmd, static ngx_int_t -ngx_http_lua_balancer_ssl_sess_store_by_chunk(lua_State *L, ngx_http_request_t *r) +ngx_http_lua_balancer_ssl_sess_store_by_chunk(lua_State *L, + ngx_http_request_t *r) { u_char *err_msg; size_t len; @@ -255,7 +258,8 @@ ngx_http_lua_balancer_ssl_sess_store_by_chunk(lua_State *L, ngx_http_request_t * } ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, - "failed to run balancer_ssl_session_store_by_lua*: %*s", len, err_msg); + "failed to run balancer_ssl_session_store_by_lua*: %*s", + len, err_msg); lua_settop(L, 0); /* clear remaining elems on stack */ @@ -290,7 +294,8 @@ ngx_http_lua_ffi_ssl_set_upstream_session(ngx_http_request_t *r, void *session, int -ngx_http_lua_ffi_ssl_get_upstream_session(ngx_http_request_t *r, void **session, char **err) +ngx_http_lua_ffi_ssl_get_upstream_session(ngx_http_request_t *r, + void **session, char **err) { ngx_ssl_session_t *ssl_session; diff --git a/src/ngx_http_lua_balancer_ssl_session_storeby.h b/src/ngx_http_lua_balancer_ssl_session_storeby.h index 711b02bb06..9ad3ed7e87 100644 --- a/src/ngx_http_lua_balancer_ssl_session_storeby.h +++ b/src/ngx_http_lua_balancer_ssl_session_storeby.h @@ -10,18 +10,19 @@ #include "ngx_http_lua_common.h" -void ngx_http_lua_balancer_ssl_sess_store(ngx_peer_connection_t *pc, void *data); +void ngx_http_lua_balancer_ssl_sess_store(ngx_peer_connection_t *pc, + void *data); -ngx_int_t ngx_http_lua_balancer_ssl_sess_store_handler_inline(ngx_http_request_t *r, - ngx_http_lua_srv_conf_t *lscf, lua_State *L); +ngx_int_t ngx_http_lua_balancer_ssl_sess_store_handler_inline( + ngx_http_request_t *r, ngx_http_lua_srv_conf_t *lscf, lua_State *L); -ngx_int_t ngx_http_lua_balancer_ssl_sess_store_handler_file(ngx_http_request_t *r, - ngx_http_lua_srv_conf_t *lscf, lua_State *L); +ngx_int_t ngx_http_lua_balancer_ssl_sess_store_handler_file( + ngx_http_request_t *r, ngx_http_lua_srv_conf_t *lscf, lua_State *L); -char *ngx_http_lua_balancer_ssl_sess_store_by_lua(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf); +char *ngx_http_lua_balancer_ssl_sess_store_by_lua(ngx_conf_t *cf, + ngx_command_t *cmd, void *conf); -char *ngx_http_lua_balancer_ssl_sess_store_by_lua_block(ngx_conf_t *cf, ngx_command_t *cmd, - void *conf); +char *ngx_http_lua_balancer_ssl_sess_store_by_lua_block(ngx_conf_t *cf, + ngx_command_t *cmd, void *conf); #endif /* _NGX_HTTP_LUA_BALANCER_SSL_SESSION_STOREBY_H_INCLUDED_ */