From 01a7965e2cdf53a9b89b00a2c32825987e838ee7 Mon Sep 17 00:00:00 2001 From: y500286920 Date: Tue, 2 Aug 2022 16:59:40 +0800 Subject: [PATCH] =?UTF-8?q?review=E4=BB=A3=E7=A0=81=E8=A7=84=E8=8C=83?= =?UTF-8?q?=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: y500286920 --- nstackx_core/dfile/core/nstackx_dfile_retransmission.c | 6 +++--- nstackx_core/dfile/core/nstackx_dfile_session.c | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/nstackx_core/dfile/core/nstackx_dfile_retransmission.c b/nstackx_core/dfile/core/nstackx_dfile_retransmission.c index aa19b4a..024c679 100644 --- a/nstackx_core/dfile/core/nstackx_dfile_retransmission.c +++ b/nstackx_core/dfile/core/nstackx_dfile_retransmission.c @@ -49,9 +49,9 @@ static void SendBackPressureFrame(DFileTrans *dFileTrans) allSize = recvListAllSize + recvInnerAllSize; uint32_t recvListWindowSize = (dFileTrans->fileManager->iowMaxRate * DFILE_KILOBYTES / NSTACKX_MILLI_TICKS) * NSTACKX_ACK_INTERVAL * FILE_RECV_LIST_SLOW_START_RATE; - if ((allSize >= dFileTrans->fileManager->iowCount * FILE_RECV_LIST_IO_WRITE_THRESHOLD) || - (allSize >= dFileTrans->fileManager->maxRecvBlockListSize * FILE_RECV_LIST_IO_WRITE_THRESHOLD) || - (allSize * blockFrameSize >= recvListWindowSize) && (allSize > 0)) { + if (allSize >= dFileTrans->fileManager->iowCount * FILE_RECV_LIST_IO_WRITE_THRESHOLD || + allSize >= dFileTrans->fileManager->maxRecvBlockListSize * FILE_RECV_LIST_IO_WRITE_THRESHOLD || + allSize * blockFrameSize >= recvListWindowSize && allSize > 0) { dFileTrans->fileManager->recvListOverIo = 1; } else { dFileTrans->fileManager->recvListOverIo = 0; diff --git a/nstackx_core/dfile/core/nstackx_dfile_session.c b/nstackx_core/dfile/core/nstackx_dfile_session.c index 25d0c0a..47d4674 100644 --- a/nstackx_core/dfile/core/nstackx_dfile_session.c +++ b/nstackx_core/dfile/core/nstackx_dfile_session.c @@ -210,10 +210,10 @@ void NoticeSessionProgress(DFileSession *session) { DFileMsg data; (void)memset_s(&data, sizeof(data), 0, sizeof(data)); - if ((FileManagerGetTotalBytes(session->fileManager, &data.transferUpdate.totalBytes) == NSTACKX_EOK) && - (FileManagerGetBytesTransferred(session->fileManager, &data.transferUpdate.bytesTransferred) == NSTACKX_EOK) && - (data.transferUpdate.bytesTransferred <= data.transferUpdate.totalBytes) && - (data.transferUpdate.bytesTransferred > 0)) { + if (FileManagerGetTotalBytes(session->fileManager, &data.transferUpdate.totalBytes) == NSTACKX_EOK && + FileManagerGetBytesTransferred(session->fileManager, &data.transferUpdate.bytesTransferred) == NSTACKX_EOK && + data.transferUpdate.bytesTransferred <= data.transferUpdate.totalBytes && + data.transferUpdate.bytesTransferred > 0) { NotifyMsgRecver(session, DFILE_ON_SESSION_IN_PROGRESS, &data); } }