Fix file recv hungup for /sys/power/state

Signed-off-by: zhaolihui <zhaolihui2@huawei.com>
This commit is contained in:
zhaolihui 2024-08-13 14:22:33 +08:00
parent 693eb42631
commit 707e3cea02
2 changed files with 2 additions and 2 deletions

View File

@ -173,7 +173,7 @@ void HdcFile::TransferSummary(CtxFile *context)
(context->fileCnt > 1 ? context->transferDirBegin : context->transferBegin); (context->fileCnt > 1 ? context->transferDirBegin : context->transferBegin);
uint64_t fSize = context->fileCnt > 1 ? context->dirSize : context->indexIO; uint64_t fSize = context->fileCnt > 1 ? context->dirSize : context->indexIO;
double fRate = static_cast<double>(fSize) / nMSec; // / /1000 * 1000 = 0 double fRate = static_cast<double>(fSize) / nMSec; // / /1000 * 1000 = 0
if (context->indexIO >= context->fileSize) { if (context->indexIO >= context->fileSize || context->lastErrno == 0) {
LogMsg(MSG_OK, "FileTransfer finish, Size:%lld, File count = %d, time:%lldms rate:%.2lfkB/s", LogMsg(MSG_OK, "FileTransfer finish, Size:%lld, File count = %d, time:%lldms rate:%.2lfkB/s",
fSize, context->fileCnt, nMSec, fRate); fSize, context->fileCnt, nMSec, fRate);
} else { } else {

View File

@ -233,7 +233,7 @@ void HdcTransferBase::OnFileIO(uv_fs_t *req)
} }
if (req->result == 0) { if (req->result == 0) {
context->ioFinish = true; context->ioFinish = true;
WRITE_LOG(LOG_INFO, "path:%s fd:%d eof", WRITE_LOG(LOG_DEBUG, "path:%s fd:%d eof",
context->localPath.c_str(), context->fsOpenReq.result); context->localPath.c_str(), context->fsOpenReq.result);
break; break;
} }