From b30d90355aeef51a6a85fd0086a902677b97a9c8 Mon Sep 17 00:00:00 2001 From: kailixu Date: Sun, 9 Apr 2023 18:55:05 +0800 Subject: [PATCH] chore: more code --- include/libs/catalog/catalog.h | 2 -- source/client/src/clientMain.c | 1 + source/common/src/tmsg.c | 4 --- source/dnode/mnode/impl/src/mndUser.c | 44 --------------------------- 4 files changed, 1 insertion(+), 50 deletions(-) diff --git a/include/libs/catalog/catalog.h b/include/libs/catalog/catalog.h index 498a6e4c7d..5895d9404d 100644 --- a/include/libs/catalog/catalog.h +++ b/include/libs/catalog/catalog.h @@ -325,8 +325,6 @@ int32_t catalogChkAuthFromCache(SCatalog* pCtg, const char* user, const char* db int32_t catalogUpdateUserAuthInfo(SCatalog* pCtg, SGetUserAuthRsp* pAuth); -// int32_t catalogUpdateUserPassInfo(SCatalog* pCtg, SGetUserPassRsp* pPass); - int32_t catalogUpdateVgEpSet(SCatalog* pCtg, const char* dbFName, int32_t vgId, SEpSet* epSet); int32_t catalogGetServerVersion(SCatalog* pCtg, SRequestConnInfo* pConn, char** pVersion); diff --git a/source/client/src/clientMain.c b/source/client/src/clientMain.c index 182750b821..3969e7e771 100644 --- a/source/client/src/clientMain.c +++ b/source/client/src/clientMain.c @@ -133,6 +133,7 @@ int taos_set_notify_cb(TAOS *taos, __taos_notify_fn_t *fp, void *param) { pObj->passInfo.fp = fp; + releaseTscObj(*(int64_t *)taos); return 0; } diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index edde771e03..2943de116d 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -192,8 +192,6 @@ void *taosDecodeSEpSet(const void *buf, SEpSet *pEp) { static int32_t tSerializeSClientHbReq(SEncoder *pEncoder, const SClientHbReq *pReq) { if (tEncodeSClientHbKey(pEncoder, &pReq->connKey) < 0) return -1; - - if (pReq->connKey.connType == CONN_TYPE__QUERY) { if (tEncodeI64(pEncoder, pReq->app.appId) < 0) return -1; if (tEncodeI32(pEncoder, pReq->app.pid) < 0) return -1; @@ -214,7 +212,6 @@ static int32_t tSerializeSClientHbReq(SEncoder *pEncoder, const SClientHbReq *pR queryNum = 1; if (tEncodeI32(pEncoder, queryNum) < 0) return -1; if (tEncodeU32(pEncoder, pReq->query->connId) < 0) return -1; - if (tEncodeI64(pEncoder, pReq->clusterId) < 0) return -1; int32_t num = taosArrayGetSize(pReq->query->queryDesc); if (tEncodeI32(pEncoder, num) < 0) return -1; @@ -279,7 +276,6 @@ static int32_t tDeserializeSClientHbReq(SDecoder *pDecoder, SClientHbReq *pReq) pReq->query = taosMemoryCalloc(1, sizeof(*pReq->query)); if (NULL == pReq->query) return -1; if (tDecodeU32(pDecoder, &pReq->query->connId) < 0) return -1; - if (tDecodeI64(pDecoder, &pReq->clusterId) < 0) return -1; int32_t num = 0; if (tDecodeI32(pDecoder, &num) < 0) return -1; if (num > 0) { diff --git a/source/dnode/mnode/impl/src/mndUser.c b/source/dnode/mnode/impl/src/mndUser.c index 2245e09187..54e5eac20e 100644 --- a/source/dnode/mnode/impl/src/mndUser.c +++ b/source/dnode/mnode/impl/src/mndUser.c @@ -791,50 +791,6 @@ _OVER: return code; } -#if 0 -static int32_t mndProcessGetUserPassReq(SRpcMsg *pReq) { - SMnode *pMnode = pReq->info.node; - int32_t code = -1; - SUserObj *pUser = NULL; - SGetUserPassReq req = {0}; - SGetUserPassRsp rsp = {0}; - - if (tDeserializeSGetUserPassReq(pReq->pCont, pReq->contLen, &req) != 0) { - terrno = TSDB_CODE_INVALID_MSG; - goto _OVER; - } - - mTrace("user:%s, start to get pass", req.user); - - pUser = mndAcquireUser(pMnode, req.user); - if (pUser == NULL) { - terrno = TSDB_CODE_MND_USER_NOT_EXIST; - goto _OVER; - } - - memcpy(rsp.user, pUser->user, TSDB_USER_LEN); - rsp.version = pUser->passVersion; - - int32_t contLen = tSerializeSGetUserPassRsp(NULL, 0, &rsp); - void *pRsp = rpcMallocCont(contLen); - if (pRsp == NULL) { - terrno = TSDB_CODE_OUT_OF_MEMORY; - goto _OVER; - } - - tSerializeSGetUserPassRsp(pRsp, contLen, &rsp); - - pReq->info.rsp = pRsp; - pReq->info.rspLen = contLen; - code = 0; - -_OVER: - - mndReleaseUser(pMnode, pUser); - - return code; -} -#endif static int32_t mndRetrieveUsers(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *pBlock, int32_t rows) { SMnode *pMnode = pReq->info.node;