From 615fe4869e1ccac80a58dff18660ee752c1bc69f Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Thu, 2 Feb 2023 17:46:58 +0800 Subject: [PATCH 1/2] fix: fix not msg to send --- source/libs/transport/src/transCli.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/libs/transport/src/transCli.c b/source/libs/transport/src/transCli.c index 1a99db5f99..be687b6193 100644 --- a/source/libs/transport/src/transCli.c +++ b/source/libs/transport/src/transCli.c @@ -800,9 +800,12 @@ static void cliSendCb(uv_write_t* req, int status) { } void cliSend(SCliConn* pConn) { - bool empty = transQueueEmpty(&pConn->cliMsgs); - ASSERTS(empty == false, "trans-cli get invalid msg"); - if (empty == true) { + SCliThrd* pThrd = pConn->hostThrd; + STrans* pTransInst = pThrd->pTransInst; + + if (transQueueEmpty(&pConn->cliMsgs)) { + tError("%s conn %p not msg to send", pTransInst->label, pConn); + cliHandleExecept(pConn); return; } @@ -812,9 +815,6 @@ void cliSend(SCliConn* pConn) { STransConnCtx* pCtx = pCliMsg->ctx; - SCliThrd* pThrd = pConn->hostThrd; - STrans* pTransInst = pThrd->pTransInst; - STransMsg* pMsg = (STransMsg*)(&pCliMsg->msg); if (pMsg->pCont == 0) { pMsg->pCont = (void*)rpcMallocCont(0); From 1766e46fca0333ceded8506f4d45c146ea7729ea Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Thu, 2 Feb 2023 21:46:48 +0800 Subject: [PATCH 2/2] fix compile error --- source/libs/transport/src/transCli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/libs/transport/src/transCli.c b/source/libs/transport/src/transCli.c index be687b6193..401f9c5120 100644 --- a/source/libs/transport/src/transCli.c +++ b/source/libs/transport/src/transCli.c @@ -805,7 +805,7 @@ void cliSend(SCliConn* pConn) { if (transQueueEmpty(&pConn->cliMsgs)) { tError("%s conn %p not msg to send", pTransInst->label, pConn); - cliHandleExecept(pConn); + cliHandleExcept(pConn); return; }