1.修改http2无法发送策略日志

2.修改命中hjack无法处理
This commit is contained in:
fengweihao
2019-06-05 11:44:26 +08:00
parent b5ec503583
commit a3bba9f5e2
3 changed files with 59 additions and 30 deletions

View File

@@ -728,6 +728,7 @@ int maat_table_ex_init(int profile_idx,
Maat_plugin_EX_dup_func_t* dup_func)
{
int table_id = 0;
const char *table_name_map[] = {"PXY_PROFILE_RESPONSE_PAGES",
"PXY_PROFILE_INSERT_SCRIPTS",
"PXY_PROFILE_HIJACK_FILES"};
@@ -1189,7 +1190,15 @@ static void template_generate(int status_code, int cfg_id, const char* msg, char
{
ctemplate::TemplateDictionary dict("pg_page_dict"); //dict is automatically finalized after function returned.
dict.SetIntValue("cfg_id", cfg_id);
dict.SetValue("msg", msg);
if (NULL == msg)
{
dict.SetValue("msg", "NULL");
}
else
{
dict.SetValue("msg", msg);
}
std::string output;
ctemplate::Template * tpl = NULL;
@@ -1418,7 +1427,7 @@ static void http_reject(const struct tfe_http_session * session, enum tfe_http_e
resp_code = param->status_code;
msg = param->message;
if (resp_code <= 0 || msg != NULL){
if (resp_code <= 0){
TFE_LOG_ERROR(g_pangu_rt->local_logger, "Invalid block rule %d", ctx->enforce_rules[0].config_id);
ctx->action = PG_ACTION_NONE;
return;
@@ -1644,7 +1653,7 @@ static void http_insert(const struct tfe_stream * stream, const struct tfe_http_
int ret=format_insert_rule(param->profile_id, param->position, ins_ctx->rule);
if (ret<0)
{
TFE_LOG_ERROR(g_pangu_rt->local_logger, "Failed to get policy table, table_id = %d", param->profile_id);
TFE_LOG_ERROR(g_pangu_rt->local_logger, "Failed to get policy table, profile_id = %d", param->profile_id);
ctx->action = PG_ACTION_NONE;
return;
}