fix: rectify the warning

Signed-off-by: jason <jialinbo@huawei.com>
This commit is contained in:
jason 2024-06-25 10:03:04 +00:00
parent ca29e88422
commit 2e0d67eaf4

View File

@ -346,7 +346,8 @@ bool DBinderBaseInvoker<T>::MoveTransData2Buffer(std::shared_ptr<T> sessionObjec
sessionBuff->UpdateSendBuffer(sendSize);
ssize_t writeCursor = sessionBuff->GetSendBufferWriteCursor();
ssize_t readCursor = sessionBuff->GetSendBufferReadCursor();
if (writeCursor < 0 || readCursor < 0 || sendSize > sessionBuff->GetSendBufferSize() - writeCursor) {
if (writeCursor < 0 || readCursor < 0 || static_cast<uint32_t>(writeCursor) > sessionBuff->GetSendBufferSize() ||
sendSize > sessionBuff->GetSendBufferSize() - static_cast<uint32_t>(writeCursor)) {
sessionBuff->ReleaseSendBufferLock();
ZLOGE(LOG_LABEL, "sender's data is large than idle buffer, writecursor:%{public}zd readcursor:%{public}zd,\
sendSize:%{public}u bufferSize:%{public}u",