From 1c85d3d9598d7e76ca16918246ab52df7d52449d Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Thu, 22 Aug 2024 09:17:26 +0800 Subject: [PATCH] fix mem problem --- source/libs/transport/src/transSvr.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/source/libs/transport/src/transSvr.c b/source/libs/transport/src/transSvr.c index a3f8c65cba..88cfd547b6 100644 --- a/source/libs/transport/src/transSvr.c +++ b/source/libs/transport/src/transSvr.c @@ -969,7 +969,7 @@ void uvOnConnectionCb(uv_stream_t* q, ssize_t nread, const uv_buf_t* buf) { // TODO(log other failure reason) tWarn("failed to create connect:%p, reason: %s", q, uv_err_name(nread)); taosMemoryFree(buf->base); - uv_close((uv_handle_t*)q, NULL); + // uv_close((uv_handle_t*)q, NULL); return; } // free memory allocated by @@ -982,32 +982,22 @@ void uvOnConnectionCb(uv_stream_t* q, ssize_t nread, const uv_buf_t* buf) { uv_pipe_t* pipe = (uv_pipe_t*)q; if (!uv_pipe_pending_count(pipe)) { tError("No pending count"); - uv_close((uv_handle_t*)q, NULL); + // uv_close((uv_handle_t*)q, NULL); return; } if (pThrd->quit) { tWarn("thread already received quit msg, ignore incoming conn"); - uv_close((uv_handle_t*)q, NULL); + // uv_close((uv_handle_t*)q, NULL); return; } SSvrConn* pConn = createConn(pThrd); if (pConn == NULL) { - uv_close((uv_handle_t*)q, NULL); + // uv_close((uv_handle_t*)q, NULL); return; } - // pConn->pTransInst = pThrd->pTransInst; - // /* init conn timer*/ - // // uv_timer_init(pThrd->loop, &pConn->pTimer); - // // pConn->pTimer.data = pConn; - // pConn->hostThrd = pThrd; - // // init client handle - // pConn->pTcp = (uv_tcp_t*)taosMemoryMalloc(sizeof(uv_tcp_t)); - // uv_tcp_init(pThrd->loop, pConn->pTcp); - // pConn->pTcp->data = pConn; - if (uv_accept(q, (uv_stream_t*)(pConn->pTcp)) == 0) { uv_os_fd_t fd; (void)uv_fileno((const uv_handle_t*)pConn->pTcp, &fd); @@ -1239,9 +1229,6 @@ static FORCE_INLINE SSvrConn* createConn(void* hThrd) { tTrace("%s handle %p, conn %p created, refId:%" PRId64, transLabel(pTransInst), exh, pConn, pConn->refId); pConn->pTransInst = pThrd->pTransInst; - /* init conn timer*/ - // uv_timer_init(pThrd->loop, &pConn->pTimer); - // pConn->pTimer.data = pConn; pConn->hostThrd = pThrd; // init client handle pConn->pTcp = (uv_tcp_t*)taosMemoryMalloc(sizeof(uv_tcp_t));