free and log
This commit is contained in:
parent
463a5da0d9
commit
d06bfd9cea
|
@ -322,7 +322,7 @@ static int32_t sdbReadFileImp(SSdb *pSdb) {
|
||||||
|
|
||||||
count = CBC_Decrypt(&opts);
|
count = CBC_Decrypt(&opts);
|
||||||
|
|
||||||
mInfo("read sdb, CBC_Decrypt dataLen:%d, descrypted len:%d, %s", pRaw->dataLen, count, __FUNCTION__);
|
mDebug("read sdb, CBC_Decrypt dataLen:%d, descrypted len:%d, %s", pRaw->dataLen, count, __FUNCTION__);
|
||||||
|
|
||||||
memcpy(pRaw->pData, plantContent, pRaw->dataLen);
|
memcpy(pRaw->pData, plantContent, pRaw->dataLen);
|
||||||
taosMemoryFree(plantContent);
|
taosMemoryFree(plantContent);
|
||||||
|
@ -456,7 +456,7 @@ static int32_t sdbWriteFileImp(SSdb *pSdb) {
|
||||||
|
|
||||||
int32_t count = CBC_Encrypt(&opts);
|
int32_t count = CBC_Encrypt(&opts);
|
||||||
|
|
||||||
mInfo("write sdb, CBC_Encrypt encryptedDataLen:%d, dataLen:%d, %s",
|
mDebug("write sdb, CBC_Encrypt encryptedDataLen:%d, dataLen:%d, %s",
|
||||||
newDataLen, pRaw->dataLen, __FUNCTION__);
|
newDataLen, pRaw->dataLen, __FUNCTION__);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -174,7 +174,7 @@ static int32_t tsdbWriteFilePage(STsdbFD *pFD, int32_t encryptAlgorithm, char* e
|
||||||
memcpy(pFD->pBuf + count, PacketData, NewLen);
|
memcpy(pFD->pBuf + count, PacketData, NewLen);
|
||||||
count += NewLen;
|
count += NewLen;
|
||||||
}
|
}
|
||||||
tsdbInfo("CBC_Encrypt count:%d %s", count, __FUNCTION__);
|
tsdbDebug("CBC_Encrypt count:%d %s", count, __FUNCTION__);
|
||||||
}
|
}
|
||||||
|
|
||||||
n = taosWriteFile(pFD->pFD, pFD->pBuf, pFD->szPage);
|
n = taosWriteFile(pFD->pFD, pFD->pBuf, pFD->szPage);
|
||||||
|
@ -264,7 +264,7 @@ static int32_t tsdbReadFilePage(STsdbFD *pFD, int64_t pgno, int32_t encryptAlgor
|
||||||
memcpy(pFD->pBuf + count, PacketData, NewLen);
|
memcpy(pFD->pBuf + count, PacketData, NewLen);
|
||||||
count += NewLen;
|
count += NewLen;
|
||||||
}
|
}
|
||||||
tsdbInfo("CBC_Decrypt count:%d %s", count, __FUNCTION__);
|
tsdbDebug("CBC_Decrypt count:%d %s", count, __FUNCTION__);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -897,7 +897,7 @@ static int tdbPagerInitPage(SPager *pPager, SPage *pPage, int (*initPage)(SPage
|
||||||
memcpy(pPage->pData + count, PacketData, NewLen);
|
memcpy(pPage->pData + count, PacketData, NewLen);
|
||||||
count += NewLen;
|
count += NewLen;
|
||||||
}
|
}
|
||||||
tdbInfo("CBC_Decrypt count:%d %s", count, __FUNCTION__);
|
tdbDebug("CBC_Decrypt count:%d %s", count, __FUNCTION__);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
init = 0;
|
init = 0;
|
||||||
|
@ -1011,7 +1011,7 @@ static int tdbPagerPWritePageToDB(SPager *pPager, SPage *pPage) {
|
||||||
memcpy(buf + count, PacketData, NewLen);
|
memcpy(buf + count, PacketData, NewLen);
|
||||||
count += NewLen;
|
count += NewLen;
|
||||||
}
|
}
|
||||||
tdbInfo("CBC_Encrypt count:%d %s", count, __FUNCTION__);
|
tdbDebug("CBC_Encrypt count:%d %s", count, __FUNCTION__);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = tdbOsPWrite(pPager->fd, buf, pPage->pageSize, offset);
|
ret = tdbOsPWrite(pPager->fd, buf, pPage->pageSize, offset);
|
||||||
|
|
|
@ -527,7 +527,7 @@ void decryptBody(SWalCfg* cfg, SWalCkHead* pHead, int32_t plainBodyLen, const ch
|
||||||
|
|
||||||
int32_t count = CBC_Decrypt(&opts);
|
int32_t count = CBC_Decrypt(&opts);
|
||||||
|
|
||||||
wInfo("CBC_Decrypt cryptedBodyLen:%d, plainBodyLen:%d, %s", count, plainBodyLen, func);
|
wDebug("CBC_Decrypt cryptedBodyLen:%d, plainBodyLen:%d, %s", count, plainBodyLen, func);
|
||||||
|
|
||||||
memcpy(pHead->head.body, newBody, plainBodyLen);
|
memcpy(pHead->head.body, newBody, plainBodyLen);
|
||||||
|
|
||||||
|
|
|
@ -545,7 +545,6 @@ static FORCE_INLINE int32_t walWriteImpl(SWal *pWal, int64_t index, tmsg_t msgTy
|
||||||
wError("vgId:%d, file:%" PRId64 ".log, failed to malloc since %s", pWal->cfg.vgId, walGetLastFileFirstVer(pWal),
|
wError("vgId:%d, file:%" PRId64 ".log, failed to malloc since %s", pWal->cfg.vgId, walGetLastFileFirstVer(pWal),
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
code = -1;
|
code = -1;
|
||||||
if(newBodyEncrypted != NULL) taosMemoryFreeClear(newBodyEncrypted);
|
|
||||||
if(newBody != NULL) taosMemoryFreeClear(newBody);
|
if(newBody != NULL) taosMemoryFreeClear(newBody);
|
||||||
goto END;
|
goto END;
|
||||||
}
|
}
|
||||||
|
@ -555,11 +554,11 @@ static FORCE_INLINE int32_t walWriteImpl(SWal *pWal, int64_t index, tmsg_t msgTy
|
||||||
opts.source = newBody;
|
opts.source = newBody;
|
||||||
opts.result = newBodyEncrypted;
|
opts.result = newBodyEncrypted;
|
||||||
opts.unitLen = 16;
|
opts.unitLen = 16;
|
||||||
strncpy(opts.key, pWal->cfg.encryptKey, 16);
|
strncpy(opts.key, pWal->cfg.encryptKey, ENCRYPT_KEY_LEN);
|
||||||
|
|
||||||
int32_t count = CBC_Encrypt(&opts);
|
int32_t count = CBC_Encrypt(&opts);
|
||||||
|
|
||||||
wInfo("vgId:%d, file:%" PRId64 ".log, index:%" PRId64 ", CBC_Encrypt cryptedBodyLen:%d, plainBodyLen:%d, %s",
|
wDebug("vgId:%d, file:%" PRId64 ".log, index:%" PRId64 ", CBC_Encrypt cryptedBodyLen:%d, plainBodyLen:%d, %s",
|
||||||
pWal->cfg.vgId, walGetLastFileFirstVer(pWal), index, count, plainBodyLen, __FUNCTION__);
|
pWal->cfg.vgId, walGetLastFileFirstVer(pWal), index, count, plainBodyLen, __FUNCTION__);
|
||||||
|
|
||||||
buf = newBodyEncrypted;
|
buf = newBodyEncrypted;
|
||||||
|
@ -580,8 +579,8 @@ static FORCE_INLINE int32_t walWriteImpl(SWal *pWal, int64_t index, tmsg_t msgTy
|
||||||
if(pWal->cfg.encryptAlgorithm == DND_CA_SM4){
|
if(pWal->cfg.encryptAlgorithm == DND_CA_SM4){
|
||||||
taosMemoryFree(newBody);
|
taosMemoryFree(newBody);
|
||||||
taosMemoryFree(newBodyEncrypted);
|
taosMemoryFree(newBodyEncrypted);
|
||||||
wInfo("vgId:%d, free newBody newBodyEncrypted %s",
|
//wInfo("vgId:%d, free newBody newBodyEncrypted %s",
|
||||||
pWal->cfg.vgId, __FUNCTION__);
|
// pWal->cfg.vgId, __FUNCTION__);
|
||||||
}
|
}
|
||||||
|
|
||||||
// set status
|
// set status
|
||||||
|
|
Loading…
Reference in New Issue