update src/common/transfer.cpp.

Signed-off-by: liupeng298 <liupeng298@huawei.com>
This commit is contained in:
liupeng298 2024-07-30 10:10:48 +00:00 committed by Gitee
parent 4a172b16e3
commit f5673a00b0
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -199,19 +199,6 @@ out:
return ret;
}
void HdcTransferBase::Next(HdcTransferBase *thisClass, CtxFile *context)
{
if (context->isDir && context->master) {
uint8_t payload = 1;
thisClass->CommandDispatch(CMD_FILE_FINISH, &payload, 1);
} else if (context->isDir && !context->master) {
uint8_t payload = 1;
thisClass->SendToAnother(CMD_FILE_FINISH, &payload, 1);
} else {
thisClass->TaskFinish();
}
}
void HdcTransferBase::OnFileIO(uv_fs_t *req)
{
CtxFileIO *contextIO = reinterpret_cast<CtxFileIO *>(req->data);
@ -241,13 +228,11 @@ void HdcTransferBase::OnFileIO(uv_fs_t *req)
context->fileSize);
#endif // HDC_DEBUG
if (!req->result && context->fileSize > 0) {
WRITE_LOG(LOG_DEBUG, "OnFileIO read size 0, isDir:%d, master:%d",
context->isDir, context->master);
thisClass->LogMsg(MSG_FAIL, "Error reading file: read nothing, path:%s",
context->localPath.c_str());
Next(thisClass, context);
return;
if (!req->result) {
context->ioFinish = true;
context->closeNotify = true;
context->lastErrno = 0;
break;
}
if (!thisClass->SendIOPayload(context, context->indexIO - req->result, bufIO, req->result)) {
context->ioFinish = true;