TSG-16056 修复deny动作,修复tsg_lua多线程调用问题和tfe编译告警

This commit is contained in:
fengweihao
2023-07-11 16:28:52 +08:00
parent 868da4f642
commit 2451bd795c
17 changed files with 73 additions and 43 deletions

View File

@@ -824,14 +824,21 @@ finish:
size_t execute_lua_script_rule(struct tsg_lua_script *lua_script, int profile_id, struct elua_context *elua_ctx, unsigned int thread_id, void *user_data)
{
int ret=0;
char *profile_msg=NULL;
size_t msg_len=0; int timeout=0;
struct elua_script **escript=NULL;
ret=lua_script->http_lua_profile(profile_id, &escript);
ret=lua_script->http_lua_profile(profile_id, &escript, &profile_msg, &msg_len, &timeout);
if(ret<0)
{
return ret;
}
if(*escript == NULL)
{
escript[thread_id]=http_lua_map_cache_script(lua_script->http_lua_handle[thread_id], profile_msg, msg_len, timeout);
}
const char *input="tfe";
size_t input_len=strlen(input);
@@ -844,6 +851,11 @@ size_t execute_lua_script_rule(struct tsg_lua_script *lua_script, int profile_id
TFE_LOG_ERROR(tsg_ctx->local_logger, "policy_id:%d, profile_id:%d, error_code:%d, error: %s", tsg_ctx->config_id, tsg_ctx->profile_id, ret, elua_get_last_error_string(lua_script->http_lua_handle[thread_id]));
}
}
if(profile_msg != NULL)
{
FREE(&profile_msg);
}
return ret;
}