summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorfengweihao <[email protected]>2022-08-01 16:05:25 +0800
committerfengweihao <[email protected]>2022-08-01 16:05:25 +0800
commite52bafad6bfd6916a1019af562b310bd8b2a8d85 (patch)
treef8ec7be209e0fad863c12a71124c9857ab4f0255 /plugin
parentc4c03bfc4e8333b7f57c230c2aa905ccb81d2e9e (diff)
bugfix:增加代理日志中sub_action行为,修复日志发送判断v4.6.16-20220801
Diffstat (limited to 'plugin')
-rw-r--r--plugin/business/pangu-http/src/pangu_http.cpp5
-rw-r--r--plugin/business/pangu-http/src/pangu_logger.cpp2
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";