summaryrefslogtreecommitdiff
path: root/plugin/business/tsg-http/src/http_lua.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/business/tsg-http/src/http_lua.cpp')
-rw-r--r--plugin/business/tsg-http/src/http_lua.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/plugin/business/tsg-http/src/http_lua.cpp b/plugin/business/tsg-http/src/http_lua.cpp
index 1832645..3087c40 100644
--- a/plugin/business/tsg-http/src/http_lua.cpp
+++ b/plugin/business/tsg-http/src/http_lua.cpp
@@ -125,7 +125,7 @@ static int http_lua_log_debug(struct elua_vm *vm)
p += snprintf(p, sizeof(buff) - (p - buff), " %s", in);
}
- TFE_LOG_DEBUG(tsg_ctx->local_logger, "policy_id:%d, profile_id:%d, message:%20s", tsg_ctx->config_id, tsg_ctx->profile_id, buff);
+ TFE_LOG_DEBUG(tsg_ctx->local_logger, "policy_id:%s, profile_id:%s, message:%20s", tsg_ctx->config_uuid_str, tsg_ctx->profile_uuid_str, buff);
http_free_params(out_lua_argv);
return 1;
@@ -161,7 +161,7 @@ static int http_lua_log_info(struct elua_vm *vm)
p += snprintf(p, sizeof(buff) - (p - buff), " %s", in);
}
- TFE_LOG_INFO(tsg_ctx->local_logger, "policy_id:%d, profile_id:%d, message:%s", tsg_ctx->config_id, tsg_ctx->profile_id, buff);
+ TFE_LOG_INFO(tsg_ctx->local_logger, "policy_id:%s, profile_id:%s, message:%s", tsg_ctx->config_uuid_str, tsg_ctx->profile_uuid_str, buff);
http_free_params(out_lua_argv);
return 1;
@@ -197,7 +197,7 @@ static int http_lua_log_error(struct elua_vm *vm)
p += snprintf(p, sizeof(buff) - (p - buff), " %s", in);
}
- TFE_LOG_ERROR(tsg_ctx->local_logger, "policy_id:%d, profile_id:%d, message:%s", tsg_ctx->config_id, tsg_ctx->profile_id, buff);
+ TFE_LOG_ERROR(tsg_ctx->local_logger, "policy_id:%s, profile_id:%s, message:%s", tsg_ctx->config_uuid_str, tsg_ctx->profile_uuid_str, buff);
http_free_params(out_lua_argv);
return 1;
@@ -683,7 +683,7 @@ static int http_lua_get_body(struct elua_vm *vm)
if(tsg_ctx->http_body == NULL)
{
- TFE_LOG_ERROR(tsg_ctx->local_logger, "policy_id:%d, profile_id:%d, message:%s", tsg_ctx->config_id, tsg_ctx->profile_id, "Can't to get req/resp body data");
+ TFE_LOG_ERROR(tsg_ctx->local_logger, "policy_id:%s, profile_id:%s, message:%s", tsg_ctx->config_uuid_str, tsg_ctx->profile_uuid_str, "Can't to get req/resp body data");
return 0;
}
@@ -829,14 +829,14 @@ finish:
return 0;
}
-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)
+size_t execute_lua_script_rule(struct tsg_lua_script *lua_script, char *profile_uuid_str, 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, &profile_msg, &msg_len, &timeout);
+ ret=lua_script->http_lua_profile(profile_uuid_str, &escript, &profile_msg, &msg_len, &timeout);
if(ret<0)
{
return ret;
@@ -856,7 +856,7 @@ size_t execute_lua_script_rule(struct tsg_lua_script *lua_script, int profile_id
struct tsg_script_ctx *tsg_ctx= (struct tsg_script_ctx *)user_data;
if(tsg_ctx != NULL && tsg_ctx->local_logger != NULL)
{
- 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]));
+ TFE_LOG_ERROR(tsg_ctx->local_logger, "policy_id:%s, profile_id:%s, error_code:%d, error: %s", tsg_ctx->config_uuid_str, tsg_ctx->profile_uuid_str, ret, elua_get_last_error_string(lua_script->http_lua_handle[thread_id]));
}
}
if(profile_msg != NULL)