未验证 提交 a4cfb4e5 编写于 作者: S Shengliang Guan 提交者: GitHub

Merge pull request #2257 from taosdata/hotfix/rpcReport

return -1 if connection is already closed
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册