From b125d214f2e80745db4724f870bff39a0a5b146c Mon Sep 17 00:00:00 2001 From: kailixu Date: Tue, 16 May 2023 09:58:53 +0800 Subject: [PATCH] chore: code optimization --- source/client/src/clientHb.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/source/client/src/clientHb.c b/source/client/src/clientHb.c index dad6627c87..0c60592fc5 100644 --- a/source/client/src/clientHb.c +++ b/source/client/src/clientHb.c @@ -547,7 +547,7 @@ static int32_t hbGetUserBasicInfo(SClientHbKey *connKey, SHbParam *param, SClien int32_t code = 0; - if ((param->passVer != INT32_MIN) && (param->passVer <= pTscObj->passInfo.ver)) { + if (param && (param->passVer != INT32_MIN) && (param->passVer <= pTscObj->passInfo.ver)) { tscDebug("hb got user basic info, no need since passVer %d <= %d", param->passVer, pTscObj->passInfo.ver); goto _return; } @@ -579,7 +579,9 @@ static int32_t hbGetUserBasicInfo(SClientHbKey *connKey, SHbParam *param, SClien } // assign the passVer - param->passVer = pTscObj->passInfo.ver; + if (param) { + param->passVer = pTscObj->passInfo.ver; + } _return: releaseTscObj(connKey->tscRid); @@ -1196,4 +1198,6 @@ void hbDeregisterConn(STscObj *pTscObj, SClientHbKey connKey) { } // set heart beat thread quit mode , if quicByKill 1 then kill thread else quit from inner -void taos_set_hb_quit(int8_t quitByKill) { clientHbMgr.quitByKill = quitByKill; } +void taos_set_hb_quit(int8_t quitByKill) { + clientHbMgr.quitByKill = quitByKill; +} -- GitLab