Merge pull request #2353 from taosdata/hotfix/refCount

reference count
This commit is contained in:
Shengliang Guan 2020-06-19 09:28:05 +08:00 committed by GitHub
commit cfac1f8a85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -108,7 +108,7 @@ typedef struct SRpcConn {
uint16_t outTranId; // outgoing transcation ID
uint16_t inTranId; // transcation ID for incoming msg
uint8_t outType; // message type for outgoing request
char inType; // message type for incoming request
uint8_t inType; // message type for incoming request
void *chandle; // handle passed by TCP/UDP connection layer
void *ahandle; // handle provided by upper app layter
int retry; // number of retry for sending request
@ -394,6 +394,8 @@ void rpcSendResponse(const SRpcMsg *pRsp) {
if ( pConn->inType == 0 || pConn->user[0] == 0 ) {
tTrace("%s, connection is already released, rsp wont be sent", pConn->info);
rpcUnlockConn(pConn);
rpcFreeCont(pMsg->pCont);
rpcDecRef(pRpc);
return;
}
@ -885,6 +887,7 @@ static void rpcReportBrokenLinkToServer(SRpcConn *pConn) {
SRpcInfo *pRpc = pConn->pRpc;
// if there are pending request, notify the app
rpcAddRef(pRpc);
tTrace("%s, notify the server app, connection is gone", pConn->info);
SRpcMsg rpcMsg;