post semaphore before memcpy
This commit is contained in:
parent
f0b483f37e
commit
44d0bfa450
|
@ -157,8 +157,8 @@ static int dnodeRetrieveUserAuthInfo(char *user, char *spi, char *encrypt, char
|
|||
if (rpcRsp.code != 0) {
|
||||
dError("user:%s, auth msg received from mnode, error:%s", user, tstrerror(rpcRsp.code));
|
||||
} else {
|
||||
dTrace("user:%s, auth msg received from mnode", user);
|
||||
SDMAuthRsp *pRsp = rpcRsp.pCont;
|
||||
dTrace("user:%s, auth msg received from mnode", user);
|
||||
memcpy(secret, pRsp->secret, TSDB_KEY_LEN);
|
||||
memcpy(ckey, pRsp->ckey, TSDB_KEY_LEN);
|
||||
*spi = pRsp->spi;
|
||||
|
|
|
@ -898,9 +898,9 @@ static void rpcNotifyClient(SRpcReqContext *pContext, SRpcMsg *pMsg) {
|
|||
|
||||
if (pContext->pRsp) {
|
||||
// for synchronous API
|
||||
tsem_post(pContext->pSem);
|
||||
memcpy(pContext->pSet, &pContext->ipSet, sizeof(SRpcIpSet));
|
||||
memcpy(pContext->pRsp, pMsg, sizeof(SRpcMsg));
|
||||
tsem_post(pContext->pSem);
|
||||
} else {
|
||||
// for asynchronous API
|
||||
SRpcIpSet *pIpSet = NULL;
|
||||
|
|
Loading…
Reference in New Issue