From e52bafad6bfd6916a1019af562b310bd8b2a8d85 Mon Sep 17 00:00:00 2001 From: fengweihao Date: Mon, 1 Aug 2022 16:05:25 +0800 Subject: [PATCH] =?UTF-8?q?bugfix:=E5=A2=9E=E5=8A=A0=E4=BB=A3=E7=90=86?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E4=B8=ADsub=5Faction=E8=A1=8C=E4=B8=BA?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E5=A4=8D=E6=97=A5=E5=BF=97=E5=8F=91=E9=80=81?= =?UTF-8?q?=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/business/pangu-http/src/pangu_http.cpp | 5 ++--- plugin/business/pangu-http/src/pangu_logger.cpp | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/plugin/business/pangu-http/src/pangu_http.cpp b/plugin/business/pangu-http/src/pangu_http.cpp index 8fac17a..6e4e01e 100644 --- a/plugin/business/pangu-http/src/pangu_http.cpp +++ b/plugin/business/pangu-http/src/pangu_http.cpp @@ -1587,6 +1587,7 @@ void http_lua(const struct tfe_stream * stream, const struct tfe_http_session * tsg_ctx->actually_executed =1; } tsg_ctx->http_req_uri=0; + tsg_ctx->execut_lua_sucess=0; tsg_ctx->replacing = tfe_http_session_request_create(to_write_sess, in_req_spec->method, in_req_spec->uri); tfe_http_session_request_set(to_write_sess, tsg_ctx->replacing); } @@ -1596,9 +1597,8 @@ void http_lua(const struct tfe_stream * stream, const struct tfe_http_session * tfe_http_session_response_set(to_write_sess, tsg_ctx->replacing); } - tsg_ctx->execut_lua_sucess=0; ret=execute_lua_script_rule(lua_script, tsg_ctx->profile_id, tsg_ctx->lua_ctx, ctx->thread_id, (void *)tsg_ctx); - if(ret>0 && tsg_ctx->actually_executed==1) + if(ret>0 && tsg_ctx->execut_lua_sucess==1) { tsg_ctx->actually_executed =1; } @@ -2981,7 +2981,6 @@ static inline int ctx_actually_replaced(struct pangu_http_ctx * ctx) static inline int ctx_actually_ran_script(struct pangu_http_ctx * ctx) { - if(ctx->action == PG_ACTION_MANIPULATE && ctx->param->action == MA_ACTION_LUA_SCRIPT && ctx->tsg_ctx->actually_executed==1) diff --git a/plugin/business/pangu-http/src/pangu_logger.cpp b/plugin/business/pangu-http/src/pangu_logger.cpp index fa98485..fc57122 100644 --- a/plugin/business/pangu-http/src/pangu_logger.cpp +++ b/plugin/business/pangu-http/src/pangu_logger.cpp @@ -122,7 +122,7 @@ int pangu_send_log(struct pangu_logger* handle, const struct pangu_log* log_msg) const char *app_proto[]= {"unkonw","http1", "http2"}; - const char *manipulate_action_map[]= {"redirect","block","replace","hijack","insert","edit_element"}; + const char *manipulate_action_map[]= {"redirect","block","replace","hijack","insert","edit_element","run_script"}; const char *panggu_action_map[__LG_ACTION_MAX]; panggu_action_map[LG_ACTION_MONIT]="monitor";