diff --git a/source/libs/transport/src/transCli.c b/source/libs/transport/src/transCli.c index 2257458fc6f26ab83aa87d2d9e916be444755cf6..da59dc605fdc0d54e0af31124b575eb8a8a12ad6 100644 --- a/source/libs/transport/src/transCli.c +++ b/source/libs/transport/src/transCli.c @@ -196,7 +196,10 @@ static void cliReleaseUnfinishedMsg(SCliConn* conn) { CONN_GET_MSGCTX_BY_AHANDLE(conn, ahandle); \ transClearBuffer(&conn->readBuf); \ transFreeMsg(transContFromHead((char*)head)); \ - if (transQueueSize(&conn->cliMsgs) > 0 && ahandle == 0) return; \ + if (transQueueSize(&conn->cliMsgs) > 0 && ahandle == 0) { \ + SCliMsg* cliMsg = transQueueGet(&conn->cliMsgs, 0); \ + if (cliMsg->type == Release) return; \ + } \ tDebug("%s conn %p receive release request, ref:%d", CONN_GET_INST_LABEL(conn), conn, T_REF_VAL_GET(conn)); \ if (T_REF_VAL_GET(conn) > 1) { \ transUnrefCliHandle(conn); \ diff --git a/source/libs/transport/src/transSvr.c b/source/libs/transport/src/transSvr.c index 86f1c5df1e2378422c944eb7ad0ad7cfe80d6cc2..ac14e22a51e2ff69bf5ec534a13bc735d95b60d4 100644 --- a/source/libs/transport/src/transSvr.c +++ b/source/libs/transport/src/transSvr.c @@ -397,11 +397,11 @@ static void uvPrepareSendData(SSvrMsg* smsg, uv_buf_t* wb) { if (pConn->status == ConnNormal) { pHead->msgType = (0 == pMsg->msgType ? pConn->inType + 1 : pMsg->msgType); + if (smsg->type == Release) pHead->msgType = 0; } else { if (smsg->type == Release) { pHead->msgType = 0; pConn->status = ConnNormal; - destroyConnRegArg(pConn); transUnrefSrvHandle(pConn); } else {