From 0b794950ee68a5a75ccdf59e2a99cd4ff46c58a1 Mon Sep 17 00:00:00 2001 From: liuxueli Date: Tue, 4 Jan 2022 17:07:02 +0300 Subject: [PATCH] =?UTF-8?q?TSG-9262:=20=E5=91=BD=E4=B8=AD=E6=8B=A6?= =?UTF-8?q?=E6=88=AA=E7=AD=96=E7=95=A5=E5=8F=91=E6=97=A5=E5=BF=97=E6=97=B6?= =?UTF-8?q?streamingo=E5=B7=B2=E9=94=80=E6=AF=81=EF=BC=8C=E4=BD=BF?= =?UTF-8?q?=E7=94=A8streaminfo=E8=8E=B7=E5=8F=96=E6=B5=81=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E6=97=B6=E5=AF=BC=E8=87=B4SAPP=E9=87=8D=E5=90=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tsg_send_log.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/tsg_send_log.cpp b/src/tsg_send_log.cpp index 4f19132..be22c9e 100644 --- a/src/tsg_send_log.cpp +++ b/src/tsg_send_log.cpp @@ -1242,6 +1242,11 @@ static int set_common_sub_action(struct TLD_handle_t *handle, char *field_name, int set_application_behavior(struct tsg_log_instance_t *_instance, struct TLD_handle_t *_handle, struct streaminfo *a_stream) { + if(a_stream==NULL) + { + return 0; + } + struct application_behavior *behavior_result=NULL; behavior_result=(struct application_behavior *)stream_bridge_async_data_get(a_stream, g_tsg_para.bridge_id[BRIDGE_TYPE_APP_BEHAVIOR_RESULT]); if(behavior_result==NULL) @@ -1256,6 +1261,11 @@ int set_application_behavior(struct tsg_log_instance_t *_instance, struct TLD_ha int set_notify_execution_result(struct tsg_log_instance_t *_instance, struct TLD_handle_t *_handle, struct streaminfo *a_stream, struct Maat_rule_t *p_result) { + if(a_stream==NULL) + { + return 0; + } + int i=0; struct tsg_notify_execution_result *execution_result=NULL; execution_result=(struct tsg_notify_execution_result *)stream_bridge_async_data_get(a_stream, g_tsg_para.bridge_id[BRIDGE_TYPE_CONN_SKETCH_EXEC_RESULT]); @@ -1268,6 +1278,8 @@ int set_notify_execution_result(struct tsg_log_instance_t *_instance, struct TLD { if(execution_result->stat_mirrored[i].compile_id==p_result->config_id) { + TLD_delete(_handle, _instance->id2field[LOG_COMMON_MIRRORED_PKTS].name); + TLD_delete(_handle, _instance->id2field[LOG_COMMON_MIRRORED_BYTES].name); TLD_append(_handle, _instance->id2field[LOG_COMMON_MIRRORED_PKTS].name, (void *)(execution_result->stat_mirrored[i].packets), TLD_TYPE_LONG); TLD_append(_handle, _instance->id2field[LOG_COMMON_MIRRORED_BYTES].name, (void *)(execution_result->stat_mirrored[i].bytes), TLD_TYPE_LONG); break;