diff options
| author | liuxueli <[email protected]> | 2021-07-22 11:53:48 +0800 |
|---|---|---|
| committer | liuxueli <[email protected]> | 2021-07-22 11:55:34 +0800 |
| commit | 95b0519cd8de5c16910da90211f92cf8894626bb (patch) | |
| tree | 29bd268f206be393637c1a622960c6a03775702c | |
| parent | e9e75ff6fd49e4a46620a0d68b5defa0edb89847 (diff) | |
修复TSG-6652: app_label只出最后一级app_name,不再输出层级关系v5.0.4
修复TSG-7056:一个链接重复扫描APP_ID之前,清空MAAT命中中间状态;一个链接间隔扫描APP_ID时间由5秒改为120秒
| -rw-r--r-- | src/tsg_entry.cpp | 8 | ||||
| -rw-r--r-- | src/tsg_send_log.cpp | 14 |
2 files changed, 17 insertions, 5 deletions
diff --git a/src/tsg_entry.cpp b/src/tsg_entry.cpp index c382eb7..77a9d8f 100644 --- a/src/tsg_entry.cpp +++ b/src/tsg_entry.cpp @@ -1477,6 +1477,12 @@ static unsigned char tsg_master_entry(const struct streaminfo *a_stream, void ** { break; } + + if(context->mid!=NULL) + { + Maat_clean_status(&context->mid); + context->mid=NULL; + } record_time_start(&context->last_scan_time); ret=tsg_scan_nesting_addr(g_tsg_maat_feather, a_stream, context->proto, &context->mid, scan_result+hit_num, MAX_RESULT_NUM-hit_num); @@ -1607,7 +1613,7 @@ extern "C" int TSG_MASTER_INIT() MESA_load_profile_int_def(tsg_conffile, "SYSTEM", "ENTRANCE_ID", &g_tsg_para.entrance_id, 0); MESA_load_profile_short_def(tsg_conffile, "SYSTEM", "TIMEOUT", (short *)&g_tsg_para.timeout, 300); - MESA_load_profile_int_def(tsg_conffile, "SYSTEM", "SCAN_TIME_INTERVAL", &g_tsg_para.scan_time_interval, 5); + MESA_load_profile_int_def(tsg_conffile, "SYSTEM", "SCAN_TIME_INTERVAL", &g_tsg_para.scan_time_interval, 120); MESA_load_profile_string_def(tsg_conffile, "SYSTEM", "DEVICE_ID_COMMAND", g_tsg_para.device_id_command, sizeof(g_tsg_para.device_id_command), NULL); g_tsg_para.device_id=get_device_id(g_tsg_para.device_id_command, g_tsg_para.entrance_id); diff --git a/src/tsg_send_log.cpp b/src/tsg_send_log.cpp index f3179d7..1f53bb0 100644 --- a/src/tsg_send_log.cpp +++ b/src/tsg_send_log.cpp @@ -463,6 +463,11 @@ static int get_l7_protocol(struct app_identify_result *result, char *protocol_li static unsigned int get_max_app_id(unsigned int *app_id_array, int app_id_num) { + if(app_id_num<=0) + { + return 0; + } + int i=0; unsigned int max_app_id=app_id_array[0]; @@ -523,12 +528,13 @@ static int get_app_name_list(unsigned int *app_id_array, int app_id_num, char *a int i=0; int offset=0; - if((*flag)==1) + if((*flag)==1 || app_id_num<=0) { return 0; } - for(i=0; i<app_id_num; i++) + //for(i=0; i<app_id_num; i++) + for(i=app_id_num-1; i<app_id_num; i++) { (*flag)=1; @@ -600,12 +606,12 @@ static int set_app_id(struct tsg_log_instance_t *_instance, struct TLD_handle_t max_app_id=get_max_app_id(label->result[ORIGIN_USER_DEFINE].app_id, label->result[ORIGIN_USER_DEFINE].app_id_num); if(max_app_id>0) { - get_app_name_list(&max_app_id, 1, app_name, sizeof(app_name), &app_id_flag, 1); + get_app_name_list(&max_app_id, 1, app_name, sizeof(app_name), &app_id_flag, 0); } if(app_id_flag!=1) { - get_app_name_list(label->result[ORIGIN_BUILT_IN].app_id, label->result[ORIGIN_BUILT_IN].app_id_num, app_name, sizeof(app_name), &app_id_flag, 1); + get_app_name_list(label->result[ORIGIN_BUILT_IN].app_id, label->result[ORIGIN_BUILT_IN].app_id_num, app_name, sizeof(app_name), &app_id_flag, 0); } if(app_id_flag!=1) |
