return -1 if connection is already closed
This commit is contained in:
parent
7b48f589e6
commit
a9ec661f0f
|
@ -83,7 +83,7 @@ void rpcSendResponse(const SRpcMsg *pMsg);
|
|||
void rpcSendRedirectRsp(void *pConn, const SRpcIpSet *pIpSet);
|
||||
int rpcGetConnInfo(void *thandle, SRpcConnInfo *pInfo);
|
||||
void rpcSendRecv(void *shandle, SRpcIpSet *pIpSet, const SRpcMsg *pReq, SRpcMsg *pRsp);
|
||||
void rpcReportProgress(void *pConn, char *pCont, int contLen);
|
||||
int rpcReportProgress(void *pConn, char *pCont, int contLen);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -486,12 +486,19 @@ 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
|
||||
void rpcReportProgress(void *handle, char *pCont, int contLen) {
|
||||
int rpcReportProgress(void *handle, char *pCont, int contLen) {
|
||||
SRpcConn *pConn = (SRpcConn *)handle;
|
||||
|
||||
// pReqMsg and reqMsgLen is re-used to store the context from app server
|
||||
pConn->pReqMsg = pCont;
|
||||
pConn->reqMsgLen = contLen;
|
||||
if (pConn->user[0]) {
|
||||
// pReqMsg and reqMsgLen is re-used to store the context from app server
|
||||
pConn->pReqMsg = pCont;
|
||||
pConn->reqMsgLen = contLen;
|
||||
return 0;
|
||||
}
|
||||
|
||||
tTrace("%s, rpc connection is already released", pConn->info);
|
||||
rpcFreeCont(pCont);
|
||||
return -1;
|
||||
}
|
||||
|
||||
static void rpcFreeMsg(void *msg) {
|
||||
|
|
Loading…
Reference in New Issue