summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorliuxueli <[email protected]>2022-12-12 11:34:44 +0800
committerliuxueli <[email protected]>2022-12-12 11:43:53 +0800
commitf5acead84aa28af4a87ebbe4e67540e3e764d119 (patch)
treee0fc21f8354dfd062e277544d2397bbf1ebe88f4
parent72bb4479ca1c5c06d0fd8b35efd068c1ca08a1d4 (diff)
TSG-13040: 修复app_identity_info日志字段未正常记录所有APP的识别过程信息的问题,本次修改后app_identity_info仅展示用户自定义及内置特征识别APP的过程。v5.8.9
-rw-r--r--src/tsg_send_log.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/tsg_send_log.cpp b/src/tsg_send_log.cpp
index 55ce72b..e1b7642 100644
--- a/src/tsg_send_log.cpp
+++ b/src/tsg_send_log.cpp
@@ -616,19 +616,20 @@ static int set_packet_bytes(struct tsg_log_instance_t *_instance, struct TLD_han
static int set_app_identify_info(struct TLD_handle_t *_handle, char *field_name, struct gather_app_result *result)
{
int i=0,j=0,ret=0;
+ int add_app_flag=0;
char app_name[512]={0};
Value array(kArrayType);
for(i=ORIGIN_USER_DEFINE; i<ORIGIN_MAX; i++)
{
- if(result[i].app_num<=0)
+ if(result[i].app_num<=0 || i==ORIGIN_QM_ENGINE)
{
continue;
}
- Value object(kObjectType);
for(j=0; j<result[i].app_num; j++)
- {
+ {
+ Value object(kObjectType);
ret=tsg_app_id2name(result[i].attributes[j].app_id, app_name, sizeof(app_name), 0);
if(ret>0)
{
@@ -638,14 +639,18 @@ static int set_app_identify_info(struct TLD_handle_t *_handle, char *field_name,
{
object.AddMember("app_name", result[i].attributes[j].app_id, _handle->document->GetAllocator());
}
- object.AddMember("packet_sequence",result[i].attributes[j].packet_sequence, _handle->document->GetAllocator());
+ object.AddMember("packet_sequence",result[i].attributes[j].packet_sequence, _handle->document->GetAllocator());
+ array.PushBack(object, _handle->document->GetAllocator());
+
+ add_app_flag=1;
}
-
- array.PushBack(object, _handle->document->GetAllocator());
}
-
- TLD_append(_handle, field_name, &array, TLD_TYPE_OBJECT);
+ if(add_app_flag==1)
+ {
+ TLD_append(_handle, field_name, &array, TLD_TYPE_OBJECT);
+ }
+
return 1;
}