diff --git a/src/common/transfer.cpp b/src/common/transfer.cpp index f7cf231b..62d66fb1 100644 --- a/src/common/transfer.cpp +++ b/src/common/transfer.cpp @@ -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(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;