From 189c241a33e507e2223468316c98bde3013f353f Mon Sep 17 00:00:00 2001 From: pumpking <297159277@qq.com> Date: Sat, 26 Jun 2021 20:05:07 +0800 Subject: [PATCH] fix del fd set bug --- .../tcp_direct/src/trans_tcp_direct_manager.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/transmission/trans_channel/tcp_direct/src/trans_tcp_direct_manager.c b/core/transmission/trans_channel/tcp_direct/src/trans_tcp_direct_manager.c index 1e352f945..685a90a34 100755 --- a/core/transmission/trans_channel/tcp_direct/src/trans_tcp_direct_manager.c +++ b/core/transmission/trans_channel/tcp_direct/src/trans_tcp_direct_manager.c @@ -215,16 +215,16 @@ void TransTdcCloseSessionConn(int32_t channelId) LOG_ERR("get tdc intfo err"); return; } - pthread_mutex_lock(&(g_sessionConnList->lock)); - ListDelete(&tdcInfo->node); - g_sessionConnList->cnt--; - pthread_mutex_unlock(&(g_sessionConnList->lock)); int fd = tdcInfo->appInfo.fd; TransTdcStopSessionConn(tdcInfo->channelId); if (fd >= 0) { LOG_INFO("fd[%d] is shutdown", fd); TcpShutDown(fd); } + pthread_mutex_lock(&(g_sessionConnList->lock)); + ListDelete(&tdcInfo->node); + g_sessionConnList->cnt--; + pthread_mutex_unlock(&(g_sessionConnList->lock)); NotifyChannelClosed(tdcInfo->channelId); }