From bf9c67405d00fe9ee962676e61ff627f35ae265b Mon Sep 17 00:00:00 2001 From: hzcheng Date: Mon, 30 Mar 2020 17:29:05 +0800 Subject: [PATCH] TD-34 --- src/rpc/src/rpcMain.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/rpc/src/rpcMain.c b/src/rpc/src/rpcMain.c index 1847475a97..78952e2209 100755 --- a/src/rpc/src/rpcMain.c +++ b/src/rpc/src/rpcMain.c @@ -829,18 +829,19 @@ static void *rpcProcessMsgFromPeer(SRecvInfo *pRecv) { pRecv->msgLen, pHead->sourceId, pHead->destId, pHead->tranId, pHead->port); } - if (terrno != TSDB_CODE_ALREADY_PROCESSED) { - if (terrno != 0) { // parsing error + int32_t code = terrno; + if (code != TSDB_CODE_ALREADY_PROCESSED) { + if (code != 0) { // parsing error if ( rpcIsReq(pHead->msgType) ) { - rpcSendErrorMsgToPeer(pRecv, terrno); - tTrace("%s %p, %s is sent with error code:%x", pRpc->label, pConn, taosMsg[pHead->msgType+1], terrno); + rpcSendErrorMsgToPeer(pRecv, code); + tTrace("%s %p, %s is sent with error code:%x", pRpc->label, pConn, taosMsg[pHead->msgType+1], code); } } else { // parsing OK rpcProcessIncomingMsg(pConn, pHead); } } - if (terrno) rpcFreeMsg(pRecv->msg); + if (code) rpcFreeMsg(pRecv->msg); return pConn; } -- GitLab