From f8f26dd672f1539b9905331f40de9ef2ed4d0bd3 Mon Sep 17 00:00:00 2001 From: Yiqing Liu Date: Sat, 19 Dec 2020 15:12:52 +0800 Subject: [PATCH] Revert "TD-2480" --- src/rpc/src/rpcMain.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/rpc/src/rpcMain.c b/src/rpc/src/rpcMain.c index 198f4ac0bd..a0c1649556 100644 --- a/src/rpc/src/rpcMain.c +++ b/src/rpc/src/rpcMain.c @@ -420,12 +420,7 @@ void rpcSendResponse(const SRpcMsg *pRsp) { SRpcMsg *pMsg = &rpcMsg; SRpcInfo *pRpc = pConn->pRpc; - if (pConn == NULL) { - rpcFreeCont(pMsg->pCont); - return; - } - - if (pMsg->pCont == NULL) { + if ( pMsg->pCont == NULL ) { pMsg->pCont = rpcMallocCont(0); pMsg->contLen = 0; } @@ -1026,7 +1021,7 @@ static void rpcReportBrokenLinkToServer(SRpcConn *pConn) { rpcMsg.pCont = pConn->pReqMsg; // pReqMsg is re-used to store the APP context from server rpcMsg.contLen = pConn->reqMsgLen; // reqMsgLen is re-used to store the APP context length rpcMsg.ahandle = pConn->ahandle; - rpcMsg.handle = NULL; + rpcMsg.handle = pConn; rpcMsg.msgType = pConn->inType; rpcMsg.code = TSDB_CODE_RPC_NETWORK_UNAVAIL; pConn->pReqMsg = NULL; -- GitLab