commit
e56f2a50a8
|
@ -630,8 +630,16 @@ static void rpcReleaseConn(SRpcConn *pConn) {
|
|||
} else {
|
||||
// if there is an outgoing message, free it
|
||||
if (pConn->outType && pConn->pReqMsg) {
|
||||
if (pConn->pContext) pConn->pContext->pConn = NULL;
|
||||
taosRemoveRef(tsRpcRefId, pConn->pContext->rid);
|
||||
SRpcReqContext *pContext = pConn->pContext;
|
||||
if (pContext->pRsp) {
|
||||
// for synchronous API, post semaphore to unblock app
|
||||
pContext->pRsp->code = TSDB_CODE_RPC_APP_ERROR;
|
||||
pContext->pRsp->pCont = NULL;
|
||||
pContext->pRsp->contLen = 0;
|
||||
tsem_post(pContext->pSem);
|
||||
}
|
||||
pContext->pConn = NULL;
|
||||
taosRemoveRef(tsRpcRefId, pContext->rid);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue