From f89406dbdcaa1a2d48a8a2a30c81d564a3cf5f4a Mon Sep 17 00:00:00 2001 From: stephenkgu Date: Sat, 12 Dec 2020 11:32:31 +0800 Subject: [PATCH] pMsgVersion/contLen: fix pMsg->contLen --- src/client/src/tscServer.c | 2 +- src/dnode/src/dnodeShell.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index 174c9ea532..a9f64e0764 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -231,7 +231,7 @@ int tscSendMsgToServer(SSqlObj *pSql) { SRpcMsg rpcMsg = { .msgType = pSql->cmd.msgType, .pCont = pMsg, - .contLen = pSql->cmd.payloadLen, + .contLen = pSql->cmd.payloadLen + sizeof(SMsgVersion), .ahandle = (void*)pSql->self, .handle = NULL, .code = 0 diff --git a/src/dnode/src/dnodeShell.c b/src/dnode/src/dnodeShell.c index 8899c92db3..221e13d109 100644 --- a/src/dnode/src/dnodeShell.c +++ b/src/dnode/src/dnodeShell.c @@ -135,9 +135,11 @@ static void dnodeProcessMsgFromShell(SRpcMsg *pMsg, SRpcEpSet *pEpSet) { return; // todo change the error code } pMsg->pCont += sizeof(*pMsgVersion); + pMsg->contLen -= sizeof(*pMsgVersion); (*dnodeProcessShellMsgFp[pMsg->msgType])(pMsg); + //pMsg->contLen += sizeof(*pMsgVersion); rpcFreeCont(pMsg->pCont - sizeof(*pMsgVersion)); } else { dError("RPC %p, shell msg:%s is not processed", pMsg->handle, taosMsg[pMsg->msgType]); -- GitLab