diff --git a/src/tsg_entry.cpp b/src/tsg_entry.cpp index 3d902c7..121762e 100644 --- a/src/tsg_entry.cpp +++ b/src/tsg_entry.cpp @@ -956,18 +956,6 @@ int session_application_metrics_update(const struct streaminfo *a_stream, struct session_increase_traffic_statis_update(¤t_traffic_statis, srt_action_context->last_traffic_statis, &increase_traffic_statis); tsg_set_application_metrics(a_stream, srt_action_context->l4_protocol, app_full_path, &increase_traffic_statis, thread_seq); -#if 0 - if(a_stream->opstate==OP_STATE_CLOSE || a_stream->pktstate==OP_STATE_CLOSE) - { - if(srt_action_context->last_traffic_statis!=NULL) - { - dictator_free(thread_seq, (void *)srt_action_context->last_traffic_statis); - srt_action_context->last_traffic_statis=NULL; - } - - return 1; - } -#endif if(srt_action_context->last_traffic_statis==NULL) { srt_action_context->last_traffic_statis=(struct traffic_packet_info *)dictator_malloc(thread_seq, sizeof(struct traffic_packet_info)); diff --git a/src/tsg_send_log.cpp b/src/tsg_send_log.cpp index df458e2..ed5e6a6 100644 --- a/src/tsg_send_log.cpp +++ b/src/tsg_send_log.cpp @@ -1713,11 +1713,6 @@ int set_session_attributes(struct tsg_log_instance_t *_instance, struct TLD_hand TLD_append(_handle, _instance->id2field[LOG_COMMON_TUNNELS_ENDPOINT_B_DESC].name, (void *)srt_attribute->server_endpoint->description, TLD_TYPE_STRING); } - if(srt_attribute->session_flags>0 && !(TLD_search(_handle, _instance->id2field[LOG_COMMON_FLAGS].name))) - { - TLD_append(_handle, _instance->id2field[LOG_COMMON_FLAGS].name, (void *)srt_attribute->session_flags, TLD_TYPE_LONG); - } - return 1; } diff --git a/test/src/gtest_master.cpp b/test/src/gtest_master.cpp index 5153a6e..24abc1a 100644 --- a/test/src/gtest_master.cpp +++ b/test/src/gtest_master.cpp @@ -1198,10 +1198,42 @@ TEST(TSGMaster, SessionQuicIdentify) g_test_quic_info=NULL; } +TEST(TSGMaster, SessionApplicationFullPathTSG13811) +{ + char out_full_path[256]={0}; + int out_full_path_len=sizeof(out_full_path); + struct gather_app_result gather_result={0}; + + gather_result.l7_protocol_num=1; + struct app_attributes l7_protocol={68, 0, 4}; + gather_result.l7_protocol=&l7_protocol; + + gather_result.qm_engine_num=3; + gather_result.l7_qm_engine_num=2; + struct app_attributes qm_engine[3]={{199, 0, 6}, {68, 0, 4}, {240, 0, 6}}; + gather_result.qm_engine=qm_engine; + + int offset=session_application_full_path_combine(&gather_result, out_full_path, out_full_path_len); + EXPECT_NE(0, offset); + EXPECT_STREQ("ssl.https.youtube", out_full_path); + + // l7 protocol is empty + gather_result.l7_protocol_num=0; + gather_result.l7_protocol=NULL; + + gather_result.qm_engine_num=3; + gather_result.l7_qm_engine_num=0; + struct app_attributes qm_engine2[3]={{199, 0, 6}, {68, 0, 4}, {240, 0, 6}}; + gather_result.qm_engine=qm_engine2; + + offset=session_application_full_path_combine(&gather_result, out_full_path, out_full_path_len); + EXPECT_NE(0, offset); + EXPECT_STREQ("ssl.https.youtube", out_full_path); +} + int main(int argc, char *argv[]) { TSG_MASTER_INIT(); testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} - +} \ No newline at end of file