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) {
|
if (rpcRsp.code != 0) {
|
||||||
dError("user:%s, auth msg received from mnode, error:%s", user, tstrerror(rpcRsp.code));
|
dError("user:%s, auth msg received from mnode, error:%s", user, tstrerror(rpcRsp.code));
|
||||||
} else {
|
} else {
|
||||||
dTrace("user:%s, auth msg received from mnode", user);
|
|
||||||
SDMAuthRsp *pRsp = rpcRsp.pCont;
|
SDMAuthRsp *pRsp = rpcRsp.pCont;
|
||||||
|
dTrace("user:%s, auth msg received from mnode", user);
|
||||||
memcpy(secret, pRsp->secret, TSDB_KEY_LEN);
|
memcpy(secret, pRsp->secret, TSDB_KEY_LEN);
|
||||||
memcpy(ckey, pRsp->ckey, TSDB_KEY_LEN);
|
memcpy(ckey, pRsp->ckey, TSDB_KEY_LEN);
|
||||||
*spi = pRsp->spi;
|
*spi = pRsp->spi;
|
||||||
|
|
|
@ -898,9 +898,9 @@ static void rpcNotifyClient(SRpcReqContext *pContext, SRpcMsg *pMsg) {
|
||||||
|
|
||||||
if (pContext->pRsp) {
|
if (pContext->pRsp) {
|
||||||
// for synchronous API
|
// for synchronous API
|
||||||
tsem_post(pContext->pSem);
|
|
||||||
memcpy(pContext->pSet, &pContext->ipSet, sizeof(SRpcIpSet));
|
memcpy(pContext->pSet, &pContext->ipSet, sizeof(SRpcIpSet));
|
||||||
memcpy(pContext->pRsp, pMsg, sizeof(SRpcMsg));
|
memcpy(pContext->pRsp, pMsg, sizeof(SRpcMsg));
|
||||||
|
tsem_post(pContext->pSem);
|
||||||
} else {
|
} else {
|
||||||
// for asynchronous API
|
// for asynchronous API
|
||||||
SRpcIpSet *pIpSet = NULL;
|
SRpcIpSet *pIpSet = NULL;
|
||||||
|
|
Loading…
Reference in New Issue