增加调试信息

This commit is contained in:
liuxueli
2019-11-25 18:36:48 +08:00
parent 7c9dabdab5
commit 4aef0628e5
2 changed files with 23 additions and 3 deletions

View File

@@ -14,7 +14,7 @@
char TSG_MASTER_VERSION_20191120=0;
char TSG_MASTER_VERSION_20191125=0;
const char *tsg_conffile="tsgconf/main.conf";
g_tsg_para_t g_tsg_para;
@@ -155,6 +155,26 @@ extern "C" char TSG_MASTER_TCP_ENTRY(struct streaminfo *a_tcp, void **pme, int t
hit_num+=ret;
identify_flag=1;
FS_operate(g_tsg_para.fs2_handle, g_tsg_para.fs2_field_id[TSG_FS2_HIT_SHARE], 0, FS_OP_ADD, 1);
MESA_handle_runtime_log(g_tsg_para.logger,
RLOG_LV_DEBUG,
"SCAN_IP_AND_DOAMIN",
"Hit %s: %s addr: %s",
(identify_info.proto==PROTO_HTTP) ? "host" : "sni",
identify_info.domain,
printaddr(&a_tcp->addr, thread_seq)
);
}
else
{
MESA_handle_runtime_log(g_tsg_para.logger,
RLOG_LV_DEBUG,
"SCAN_IP_AND_DOAMIN",
"Not hit %s: %s addr: %s",
(ret==0) ? ((identify_info.proto==PROTO_HTTP) ? "host" : "sni") : "NULL",
(ret==0) ? identify_info.domain : "NULL",
printaddr(&a_tcp->addr, thread_seq)
);
}

View File

@@ -76,7 +76,7 @@ int tsg_rule_init(const char* conffile, void *logger)
Maat_set_feather_opt(g_tsg_maat_feather, MAAT_OPT_PERF_ON, NULL, 0);
Maat_set_feather_opt(g_tsg_maat_feather, MAAT_OPT_REDIS_INDEX, &redis_index, sizeof(redis_index));
Maat_set_feather_opt(g_tsg_maat_feather, MAAT_OPT_SCAN_DETAIL, &scan_detail, sizeof(scan_detail));
Maat_set_feather_opt(g_tsg_maat_feather, MAAT_OPT_DEFERRED_LOAD, NULL,0);
//Maat_set_feather_opt(g_tsg_maat_feather, MAAT_OPT_DEFERRED_LOAD, NULL,0);
}
else
{
@@ -304,7 +304,7 @@ int tsg_scan_nesting_addr(Maat_feather_t maat_feather, const struct streaminfo *
}while(cur_stream != NULL && hit_num < result_num);
if(hit_num < result_num)
if(hit_num<result_num && subscribe_id!=NULL && strlen(subscribe_id)>0)
{
maat_ret=Maat_full_scan_string(maat_feather,
g_tsg_para.subscribe_id_table_id,