“40c45e2cccfed29817d907a575f6a16339cba170”上不存在“test_tipc/git@gitcode.net:s920243400/PaddleOCR.git”
提交 28d73164 编写于 作者: K kailixu

chore: add enable is tsc obj

上级 3c7924ed
......@@ -632,6 +632,7 @@ typedef struct {
int8_t superUser;
int8_t sysInfo;
int8_t connType;
int8_t enable;
SEpSet epSet;
int32_t svrTimestamp;
int32_t passVer;
......
......@@ -141,6 +141,7 @@ typedef struct STscObj {
char sVer[TSDB_VERSION_LEN];
char sDetailVer[128];
int8_t sysInfo;
int8_t enable;
int8_t connType;
int32_t acctId;
uint32_t connId;
......
......@@ -104,6 +104,12 @@ static int32_t hbUpdateUserAuthInfo(SAppHbMgr *pAppHbMgr, SUserAuthBatchRsp *bat
pTscObj->sysInfo = pRsp->sysInfo;
}
if (pTscObj->enable != pRsp->enable) {
tscDebug("update enable of user %s from %" PRIi8 " to %" PRIi8 ", tscRid:%" PRIi64, pRsp->user, pTscObj->enable,
pRsp->enable, pTscObj->id);
pTscObj->enable = pRsp->enable;
}
if (pTscObj->passInfo.fp) {
SPassInfo *passInfo = &pTscObj->passInfo;
int32_t oldVer = atomic_load_32(&passInfo->ver);
......
......@@ -4117,7 +4117,8 @@ int32_t tSerializeSConnectRsp(void *buf, int32_t bufLen, SConnectRsp *pRsp) {
if (tEncodeCStr(&encoder, pRsp->sVer) < 0) return -1;
if (tEncodeCStr(&encoder, pRsp->sDetailVer) < 0) return -1;
if (tEncodeI32(&encoder, pRsp->passVer) < 0) return -1;
if (tEncodeI32(&encoder, pRsp->authVer) < 0) return -1;
if (tEncodeI32(&encoder, pRsp->authVer) < 0) return -1; // since 3.0.7.0
if (tEncodeI8(&encoder, pRsp->enable) < 0) return -1; // since 3.1.0.0
tEndEncode(&encoder);
int32_t tlen = encoder.pos;
......@@ -4153,6 +4154,12 @@ int32_t tDeserializeSConnectRsp(void *buf, int32_t bufLen, SConnectRsp *pRsp) {
} else {
pRsp->authVer = 0;
}
// since 3.1.0.0
if (!tDecodeIsEnd(&decoder)) {
if (tDecodeI8(&decoder, &pRsp->enable) < 0) return -1;
} else {
pRsp->enable = 0;
}
tEndDecode(&decoder);
......
......@@ -282,6 +282,7 @@ _CONNECT:
connectRsp.acctId = pUser->acctId;
connectRsp.superUser = pUser->superUser;
connectRsp.sysInfo = pUser->sysInfo;
connectRsp.enable = pUser->enable;
connectRsp.clusterId = pMnode->clusterId;
connectRsp.connId = pConn->id;
connectRsp.connType = connReq.connType;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册