modify file transfer

Signed-off-by: liuwei <liuwei573@huawei.com>
This commit is contained in:
liuwei 2024-08-22 19:42:50 +08:00
parent fe9751dafa
commit cc4e4641f5

View File

@ -686,11 +686,9 @@ bool HdcTransferBase::CommandDispatch(const uint16_t command, uint8_t *payload,
// Note, I will trigger FileIO after multiple times.
CtxFile *context = &ctxNow;
if (!RecvIOPayload(context, payload, payloadSize)) {
WRITE_LOG(LOG_DEBUG, "CommandDispatch RecvIOPayload return false. channelId:%u lastErrno:%u result:%d",
taskInfo->channelId, ctxNow.lastErrno, ctxNow.fsOpenReq.result);
if (ctxNow.lastErrno != 0 || ctxNow.fsOpenReq.result > 0 ) {
uv_fs_close(nullptr, &ctxNow.fsCloseReq, ctxNow.fsOpenReq.result, nullptr);
}
WRITE_LOG(LOG_DEBUG, "RecvIOPayload return false. channelId:%u lastErrno:%u result:%d",
taskInfo->channelId, ctxNow.lastErrno, ctxNow.fsOpenReq.result);
uv_fs_close(nullptr, &ctxNow.fsCloseReq, ctxNow.fsOpenReq.result, nullptr);
HdcTransferBase *thisClass = (HdcTransferBase *)context->thisClass;
thisClass->CommandDispatch(CMD_FILE_FINISH, payload, 1);
ret = false;