提交 0336c44d 编写于 作者: U ubuntu

handle except

上级 eb081fc2
...@@ -320,7 +320,7 @@ void cliHandleExcept(SCliConn* pConn) { ...@@ -320,7 +320,7 @@ void cliHandleExcept(SCliConn* pConn) {
SCliThrdObj* pThrd = pConn->hostThrd; SCliThrdObj* pThrd = pConn->hostThrd;
STrans* pTransInst = pThrd->pTransInst; STrans* pTransInst = pThrd->pTransInst;
do { while(!transQueueEmpty(&pConn->cliMsgs)){
SCliMsg* pMsg = transQueuePop(&pConn->cliMsgs); SCliMsg* pMsg = transQueuePop(&pConn->cliMsgs);
STransConnCtx* pCtx = pMsg ? pMsg->ctx : NULL; STransConnCtx* pCtx = pMsg ? pMsg->ctx : NULL;
...@@ -343,16 +343,19 @@ void cliHandleExcept(SCliConn* pConn) { ...@@ -343,16 +343,19 @@ void cliHandleExcept(SCliConn* pConn) {
} }
if (pCtx == NULL || pCtx->pSem == NULL) { if (pCtx == NULL || pCtx->pSem == NULL) {
tTrace("%s cli conn %p handle resp", pTransInst->label, pConn); tTrace("%s cli conn %p handle except", pTransInst->label, pConn);
if (transMsg.ahandle == NULL) {
continue;
}
(pTransInst->cfp)(pTransInst->parent, &transMsg, NULL); (pTransInst->cfp)(pTransInst->parent, &transMsg, NULL);
} else { } else {
tTrace("%s cli conn(sync) %p handle resp", pTransInst->label, pConn); tTrace("%s cli conn(sync) %p handle except", pTransInst->label, pConn);
memcpy((char*)(pCtx->pRsp), (char*)(&transMsg), sizeof(transMsg)); memcpy((char*)(pCtx->pRsp), (char*)(&transMsg), sizeof(transMsg));
tsem_post(pCtx->pSem); tsem_post(pCtx->pSem);
} }
destroyCmsg(pMsg); destroyCmsg(pMsg);
tTrace("%s cli conn %p start to destroy", CONN_GET_INST_LABEL(pConn), pConn); tTrace("%s cli conn %p start to destroy", CONN_GET_INST_LABEL(pConn), pConn);
} while (!transQueueEmpty(&pConn->cliMsgs)); };
transUnrefCliHandle(pConn); transUnrefCliHandle(pConn);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册