mirror of
https://gitee.com/openharmony/developtools_hdc
synced 2024-11-27 17:20:32 +00:00
update src/common/transfer.cpp.
Signed-off-by: liupeng298 <liupeng298@huawei.com>
This commit is contained in:
parent
4a172b16e3
commit
f5673a00b0
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user