!1452 revert 'Pull Request !1380 : fix: hdc file recv /sys/power/state 卡死'

Merge pull request !1452 from kun chen/master
This commit is contained in:
openharmony_ci 2024-08-12 07:27:40 +00:00 committed by Gitee
commit c3ed97c17b
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 1 additions and 23 deletions

View File

@ -32,7 +32,7 @@ private:
void CheckMaster(CtxFile *context) override; void CheckMaster(CtxFile *context) override;
void WhenTransferFinish(CtxFile *context) override; void WhenTransferFinish(CtxFile *context) override;
bool BeginTransfer(CtxFile *context, const string &command); bool BeginTransfer(CtxFile *context, const string &command);
void TransferSummary(CtxFile *context) override; void TransferSummary(CtxFile *context);
bool SetMasterParameters(CtxFile *context, const char *command, int argc, char **argv); bool SetMasterParameters(CtxFile *context, const char *command, int argc, char **argv);
bool FileModeSync(const uint16_t cmd, uint8_t *payload, const int payloadSize); bool FileModeSync(const uint16_t cmd, uint8_t *payload, const int payloadSize);
}; };

View File

@ -202,19 +202,6 @@ out:
return ret; return ret;
} }
void HdcTransferBase::Next(HdcTransferBase *thisClass, CtxFile *context)
{
if (context->isDir) {
uint8_t payload = 1;
uint16_t cmdFinish = (thisClass->commandBegin == CMD_FILE_BEGIN ? CMD_FILE_FINISH : CMD_APP_FINISH);
thisClass->CommandDispatch(cmdFinish, &payload, 1);
} else {
thisClass->TransferSummary(context);
thisClass->TaskFinish();
}
return;
}
void HdcTransferBase::OnFileIO(uv_fs_t *req) void HdcTransferBase::OnFileIO(uv_fs_t *req)
{ {
CtxFileIO *contextIO = reinterpret_cast<CtxFileIO *>(req->data); CtxFileIO *contextIO = reinterpret_cast<CtxFileIO *>(req->data);
@ -243,11 +230,6 @@ void HdcTransferBase::OnFileIO(uv_fs_t *req)
WRITE_LOG(LOG_DEBUG, "read file data %" PRIu64 "/%" PRIu64 "", context->indexIO, WRITE_LOG(LOG_DEBUG, "read file data %" PRIu64 "/%" PRIu64 "", context->indexIO,
context->fileSize); context->fileSize);
#endif // HDC_DEBUG #endif // HDC_DEBUG
if (req->result == 0 && context->fileSize > 0) {
Next(thisClass, context);
return;
}
if (!thisClass->SendIOPayload(context, context->indexIO - req->result, bufIO, req->result)) { if (!thisClass->SendIOPayload(context, context->indexIO - req->result, bufIO, req->result)) {
context->ioFinish = true; context->ioFinish = true;
break; break;

View File

@ -121,9 +121,6 @@ protected:
virtual void WhenTransferFinish(CtxFile *context) virtual void WhenTransferFinish(CtxFile *context)
{ {
} }
virtual void TransferSummary(CtxFile *context)
{
}
bool MatchPackageExtendName(string fileName, string extName); bool MatchPackageExtendName(string fileName, string extName);
bool ResetCtx(CtxFile *context, bool full = false); bool ResetCtx(CtxFile *context, bool full = false);
bool SmartSlavePath(string &cwd, string &localPath, const char *optName); bool SmartSlavePath(string &cwd, string &localPath, const char *optName);
@ -150,7 +147,6 @@ private:
}; };
static const uint8_t payloadPrefixReserve = 64; static const uint8_t payloadPrefixReserve = 64;
static void OnFileIO(uv_fs_t *req); static void OnFileIO(uv_fs_t *req);
static void Next(HdcTransferBase *thisClass, CtxFile *context);
int SimpleFileIO(CtxFile *context, uint64_t index, uint8_t *sendBuf, int bytes); int SimpleFileIO(CtxFile *context, uint64_t index, uint8_t *sendBuf, int bytes);
bool SendIOPayload(CtxFile *context, uint64_t index, uint8_t *data, int dataSize); bool SendIOPayload(CtxFile *context, uint64_t index, uint8_t *data, int dataSize);
bool RecvIOPayload(CtxFile *context, uint8_t *data, int dataSize); bool RecvIOPayload(CtxFile *context, uint8_t *data, int dataSize);