This commit is contained in:
Jeff Tao 2020-06-16 13:12:27 +00:00
parent 387f162ddf
commit f3f0e39ab1
1 changed files with 8 additions and 6 deletions

View File

@ -489,20 +489,22 @@ void rpcSendRecv(void *shandle, SRpcIpSet *pIpSet, const SRpcMsg *pMsg, SRpcMsg
// this API is used by server app to keep an APP context in case connection is broken // this API is used by server app to keep an APP context in case connection is broken
int rpcReportProgress(void *handle, char *pCont, int contLen) { int rpcReportProgress(void *handle, char *pCont, int contLen) {
SRpcConn *pConn = (SRpcConn *)handle; SRpcConn *pConn = (SRpcConn *)handle;
int code = 0;
rpcLockConn(pConn); rpcLockConn(pConn);
if (pConn->user[0]) { if (pConn->user[0]) {
// pReqMsg and reqMsgLen is re-used to store the context from app server // pReqMsg and reqMsgLen is re-used to store the context from app server
pConn->pReqMsg = pCont; pConn->pReqMsg = pCont;
pConn->reqMsgLen = contLen; pConn->reqMsgLen = contLen;
return 0; } else {
tTrace("%s, rpc connection is already released", pConn->info);
rpcFreeCont(pCont);
code = -1;
} }
tTrace("%s, rpc connection is already released", pConn->info);
rpcFreeCont(pCont);
rpcUnlockConn(pConn); rpcUnlockConn(pConn);
return code;
return -1;
} }
/* todo: cancel process may have race condition, pContext may have been released /* todo: cancel process may have race condition, pContext may have been released