diff --git a/src/tsg_entry.cpp b/src/tsg_entry.cpp index 37a3030..7af7549 100644 --- a/src/tsg_entry.cpp +++ b/src/tsg_entry.cpp @@ -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) + ); } p_result=tsg_policy_decision_criteria(all_result, hit_num); diff --git a/src/tsg_rule.cpp b/src/tsg_rule.cpp index 245ae79..e812eb9 100644 --- a/src/tsg_rule.cpp +++ b/src/tsg_rule.cpp @@ -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_num0) { maat_ret=Maat_full_scan_string(maat_feather, g_tsg_para.subscribe_id_table_id,