mirror of
https://github.com/openharmony/communication_t2stack.git
synced 2026-07-21 08:45:25 -04:00
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user