APP_ID域表intval匹配模式修改

This commit is contained in:
fengweihao
2020-09-03 11:50:52 +08:00
parent fbc7b5a715
commit 5302adb66a
3 changed files with 19 additions and 23 deletions

View File

@@ -173,15 +173,15 @@ static void pangu_http_stat_init(struct pangu_rt * pangu_runtime)
const char* spec[__PG_STAT_MAX]={0};
spec[STAT_SESSION]="http_sess";
spec[STAT_LOG_NUM]="log_num";
spec[STAT_ACTION_MONIT]="intercept_monitor_conn_num";
spec[STAT_ACTION_REJECT]="intercept_deny_conn_num";
spec[STAT_ACTION_REDIRECT]="intercept_redirect_conn_num";
spec[STAT_ACTION_REPLACE]="intercept_replace_conn_num";
spec[STAT_ACTION_HIJACK]="intercept_hijack_conn_num";
spec[STAT_ACTION_HIJACK_SZ]="hijack_bytes";
spec[STAT_ACTION_INSERT]="intercept_insert_conn_num";
spec[STAT_ACTION_INSERT_SZ]="insert_bytes";
spec[STAT_ACTION_WHITELSIT]="intercept_allow_conn_num";
spec[STAT_ACTION_MONIT]="intcp_mon_num";
spec[STAT_ACTION_REJECT]="intcp_deny_num";
spec[STAT_ACTION_REDIRECT]="intcp_rdirt_num";
spec[STAT_ACTION_REPLACE]="intcp_repl_num";
spec[STAT_ACTION_HIJACK]="intcp_hijk_num";
spec[STAT_ACTION_HIJACK_SZ]="hijk_bytes";
spec[STAT_ACTION_INSERT]="intcp_ins_num";
spec[STAT_ACTION_INSERT_SZ]="ins_bytes";
spec[STAT_ACTION_WHITELSIT]="intcp_allow_num";
spec[STAT_SUSPENDING]="suspending";
for(i=0;i<__PG_STAT_MAX;i++)
@@ -2368,11 +2368,8 @@ void pangu_on_http_begin(const struct tfe_stream * stream,
hit_cnt+=scan_ret;
}
const char *app_id = "http.";
scan_ret = Maat_full_scan_string(g_pangu_rt->maat, g_pangu_rt->scan_table_id[PXY_CTRL_APP_ID],
CHARSET_UTF8, app_id, strlen(app_id),
result+hit_cnt, NULL, MAX_SCAN_RESULT-hit_cnt,
&(ctx->scan_mid), (int) thread_id);
int scan_val=106;
scan_ret=Maat_scan_intval(g_pangu_rt->maat, g_pangu_rt->scan_table_id[PXY_CTRL_APP_ID], scan_val, result+hit_cnt, MAX_SCAN_RESULT-hit_cnt, &(ctx->scan_mid), (int) thread_id);
if(scan_ret>0)
{
hit_cnt+=scan_ret;
@@ -2498,7 +2495,7 @@ void pangu_on_http_end(const struct tfe_stream * stream,
ret=pangu_send_log(g_pangu_rt->send_logger, &log_msg);
ATOMIC_ADD(&(g_pangu_rt->stat_val[STAT_LOG_NUM]), ret);
}
if(ctx->rep_ctx && ctx->rep_ctx->actually_replaced==0)
if(ctx->rep_ctx && ctx->rep_ctx->actually_replaced==1)
{
ATOMIC_INC(&(g_pangu_rt->stat_val[STAT_ACTION_REPLACE]));
}