From 7ea9288da4d86e15205e633e307f696e6cafc6cd Mon Sep 17 00:00:00 2001 From: liuxueli Date: Wed, 11 Jan 2023 14:52:48 +0800 Subject: TSG-13031: 没有原始数据包时获取direction可能存在异常,调整获取direction的时机,即在第一个数据包时获取direction MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tsg_send_log.cpp | 35 +++++------------------------------ 1 file changed, 5 insertions(+), 30 deletions(-) (limited to 'src/tsg_send_log.cpp') diff --git a/src/tsg_send_log.cpp b/src/tsg_send_log.cpp index 77b814c..6fce17c 100644 --- a/src/tsg_send_log.cpp +++ b/src/tsg_send_log.cpp @@ -382,39 +382,14 @@ static int set_location(struct TLD_handle_t *_handle, struct streaminfo *a_strea static int set_direction(struct tsg_log_instance_t *_instance, struct TLD_handle_t *_handle, struct streaminfo *a_stream) { - int direction=0,i_or_e=0; - - i_or_e=MESA_dir_link_to_human(a_stream->routedir); - switch(a_stream->curdir) + char direction=get_direction_from_tcpall(a_stream); + if(direction>0) { - case DIR_C2S: - if(i_or_e=='E' || i_or_e=='e') - { - direction='E'; - } - else - { - direction='I'; - } - break; - case DIR_S2C: - if(i_or_e=='E' || i_or_e=='e') - { - direction='I'; - } - else - { - direction='E'; - } - break; - default: - break; + TLD_append(_handle, _instance->id2field[LOG_COMMON_DIRECTION].name, (void *)(long)direction, TLD_TYPE_LONG); + return 1; } - - TLD_append(_handle, _instance->id2field[LOG_COMMON_DIRECTION].name, (void *)(long)direction, TLD_TYPE_LONG); - - return 1; + return 0; } static int set_address_list(struct tsg_log_instance_t *_instance, struct TLD_handle_t *_handle, struct streaminfo *a_stream) -- cgit v1.2.3