enh: code optimization

This commit is contained in:
kailixu 2024-04-16 09:04:33 +08:00
parent a6fe9a861f
commit 8ea9c8b879
1 changed files with 4 additions and 3 deletions

View File

@ -234,10 +234,10 @@ int32_t dmProcessCreateEncryptKeyReq(SDnodeMgmt *pMgmt, SRpcMsg *pMsg) {
} }
code = dmUpdateEncryptKey(cfgReq.value); code = dmUpdateEncryptKey(cfgReq.value);
if(code == 0) { if (code == 0) {
tsEncryptionKeyChksum = taosCalcChecksum(0, cfgReq.value, strlen(cfgReq.value)); tsEncryptionKeyChksum = taosCalcChecksum(0, cfgReq.value, strlen(cfgReq.value));
tsEncryptionKeyStat = ENCRYPT_KEY_STAT_LOADED; tsEncryptionKeyStat = ENCRYPT_KEY_STAT_LOADED;
strncpy(tsEncryptKey, cfgReq.value, ENCRYPT_KEY_LEN + 1); tstrncpy(tsEncryptKey, cfgReq.value, ENCRYPT_KEY_LEN + 1);
} }
pMsg->code = code; pMsg->code = code;
@ -245,8 +245,9 @@ int32_t dmProcessCreateEncryptKeyReq(SDnodeMgmt *pMgmt, SRpcMsg *pMsg) {
pMsg->info.rspLen = 0; pMsg->info.rspLen = 0;
_exit: _exit:
return code; return code;
#endif #else
return 0; return 0;
#endif
} }
static void dmGetServerRunStatus(SDnodeMgmt *pMgmt, SServerStatusRsp *pStatus) { static void dmGetServerRunStatus(SDnodeMgmt *pMgmt, SServerStatusRsp *pStatus) {