chore: more code

This commit is contained in:
kailixu 2023-06-28 20:57:05 +08:00
parent aefebfca7f
commit 1e9b85545b
2 changed files with 11 additions and 12 deletions

View File

@ -105,10 +105,10 @@ static int32_t hbProcessUserPassInfoRsp(void *value, int32_t valueLen, SClientHb
continue; continue;
} }
SPassInfo *passInfo = &pTscObj->passInfo; SPassInfo *passInfo = &pTscObj->passInfo;
// if (!passInfo->fp) { if (!passInfo->fp) {
// releaseTscObj(pReq->connKey.tscRid); releaseTscObj(pReq->connKey.tscRid);
// continue; continue;
// } }
for (int32_t i = 0; i < numOfBatchs; ++i) { for (int32_t i = 0; i < numOfBatchs; ++i) {
SGetUserPassRsp *rsp = taosArrayGet(batchRsp.pArray, i); SGetUserPassRsp *rsp = taosArrayGet(batchRsp.pArray, i);
@ -119,7 +119,7 @@ static int32_t hbProcessUserPassInfoRsp(void *value, int32_t valueLen, SClientHb
if (passInfo->fp) { if (passInfo->fp) {
(*passInfo->fp)(passInfo->param, &passInfo->ver, TAOS_NOTIFY_PASSVER); (*passInfo->fp)(passInfo->param, &passInfo->ver, TAOS_NOTIFY_PASSVER);
} }
printf("update passVer of user %s from %d to %d, tscRid:%" PRIi64 "\n", rsp->user, oldVer, tscDebug("update passVer of user %s from %d to %d, tscRid:%" PRIi64, rsp->user, oldVer,
atomic_load_32(&passInfo->ver), pTscObj->id); atomic_load_32(&passInfo->ver), pTscObj->id);
} }
break; break;
@ -588,9 +588,9 @@ static int32_t hbGetUserBasicInfo(SClientHbKey *connKey, SHbParam *param, SClien
if ((pKv = taosHashGet(req->info, &kv.key, sizeof(kv.key)))) { if ((pKv = taosHashGet(req->info, &kv.key, sizeof(kv.key)))) {
SUserPassVersion *pPassVer = (SUserPassVersion *)pKv->value; SUserPassVersion *pPassVer = (SUserPassVersion *)pKv->value;
tscDebug("hb got user basic info, already exists:%s, update passVer from %d to %d", pTscObj->user, tscDebug("hb got user basic info, already exists:%s, update passVer from %d to %d", pTscObj->user,
pPassVer->version, pTscObj->passInfo.ver); htonl(pPassVer->version), pTscObj->passInfo.ver);
pPassVer->version = pTscObj->passInfo.ver; pPassVer->version = htonl(pTscObj->passInfo.ver);
if (param) param->passVer = pPassVer->version; if (param) param->passVer = pTscObj->passInfo.ver;
goto _return; goto _return;
} }
@ -867,9 +867,9 @@ int32_t hbQueryHbReqHandle(SClientHbKey *connKey, void *param, SClientHbReq *req
hbGetQueryBasicInfo(connKey, req); hbGetQueryBasicInfo(connKey, req);
// if (hbParam->passKeyCnt > 0) { if (hbParam->passKeyCnt > 0) {
hbGetUserBasicInfo(connKey, hbParam, req); hbGetUserBasicInfo(connKey, hbParam, req);
// } }
if (hbParam->reqCnt == 0) { if (hbParam->reqCnt == 0) {
code = hbGetExpiredUserInfo(connKey, pCatalog, req); code = hbGetExpiredUserInfo(connKey, pCatalog, req);

View File

@ -1383,8 +1383,7 @@ int32_t mndValidateUserAuthInfo(SMnode *pMnode, SUserAuthVersion *pUsers, int32_
pUsers[i].version = ntohl(pUsers[i].version); pUsers[i].version = ntohl(pUsers[i].version);
if (pUser->authVersion <= pUsers[i].version) { if (pUser->authVersion <= pUsers[i].version) {
printf("%s:%d pUser->authVersion:%d <= pUsers[i].version:%d\n", __func__, __LINE__, pUser->authVersion, mTrace("pUser->authVersion:%d <= pUsers[i].version:%d", pUser->authVersion, pUsers[i].version);
pUsers[i].version);
mndReleaseUser(pMnode, pUser); mndReleaseUser(pMnode, pUser);
continue; continue;
} }