diff --git a/src/common/channel.cpp b/src/common/channel.cpp index e62478e8106fb8a73f6ac9ffec654074b1a19b9f..c20f6fb6a49dacebd97beb66eae6965cc65450cb 100644 --- a/src/common/channel.cpp +++ b/src/common/channel.cpp @@ -180,6 +180,7 @@ void HdcChannelBase::WriteCallback(uv_write_t *req, int status) --hChannel->ref; HdcChannelBase *thisClass = (HdcChannelBase *)hChannel->clsChannel; if (status < 0) { + WRITE_LOG(LOG_WARN, "WriteCallback status:%d", status); hChannel->writeFailedTimes++; Base::TryCloseHandle((uv_handle_t *)req->handle); if (!hChannel->isDead && !hChannel->ref) { diff --git a/src/common/file.cpp b/src/common/file.cpp index fdb6271b5f565b10a02c37f5d004110449acf37a..226c38b2484522009d779602a99f516bbe6fbc75 100644 --- a/src/common/file.cpp +++ b/src/common/file.cpp @@ -269,11 +269,13 @@ bool HdcFile::SlaveCheck(uint8_t *payload, const int payloadSize) if (!CheckLocalPath(ctxNow.localPath, stat.optionalName, errStr)) { LogMsg(MSG_FAIL, "%s", errStr.c_str()); + WRITE_LOG(LOG_WARN, "SlaveCheck CheckLocalPath error:%s", errStr.c_str()); return false; } if (!CheckFilename(ctxNow.localPath, stat.optionalName, errStr)) { LogMsg(MSG_FAIL, "%s", errStr.c_str()); + WRITE_LOG(LOG_WARN, "SlaveCheck CheckFilename error:%s", errStr.c_str()); return false; } // check path diff --git a/src/common/transfer.cpp b/src/common/transfer.cpp index a7a6d9e573f91473c602da42286522be8cedd7f2..07521c27aa77128a2339763a8515a64248268fd5 100644 --- a/src/common/transfer.cpp +++ b/src/common/transfer.cpp @@ -136,6 +136,7 @@ int HdcTransferBase::SimpleFileIO(CtxFile *context, uint64_t index, uint8_t *sen if (ioContext != nullptr) { delete ioContext; ioContext = nullptr; + WRITE_LOG(LOG_WARN, "SimpleFileIO ret=false, delete context."); } #ifndef CONFIG_USE_JEMALLOC_DFX_INIF cirbuf.Free(buf); @@ -212,9 +213,13 @@ bool HdcTransferBase::SendIOPayload(CtxFile *context, uint64_t index, uint8_t *d payloadHead.compressSize = compressSize; head = SerialStruct::SerializeToString(payloadHead); if (head.size() + 1 > payloadPrefixReserve) { + WRITE_LOG(LOG_WARN, "SendIOPayload head size:%d, payloadprefix:%d.", + head.size(), payloadPrefixReserve); goto out; } if (EOK != memcpy_s(sendBuf, sendBufSize, head.c_str(), head.size() + 1)) { + WRITE_LOG(LOG_WARN, "SendIOPayload memcpy_s fail, sendBufSize:%d, head size:%d.", + sendBufSize, head.size()); goto out; } ret = SendToAnother(commandData, sendBuf, payloadPrefixReserve + compressSize) > 0; @@ -256,6 +261,7 @@ void HdcTransferBase::OnFileIO(uv_fs_t *req) context->fileSize); #endif // HDC_DEBUG if (!thisClass->SendIOPayload(context, context->indexIO - req->result, bufIO, req->result)) { + WRITE_LOG(LOG_WARN, "OnFileIO SendIOPayload fail."); context->ioFinish = true; break; } @@ -352,7 +358,8 @@ void HdcTransferBase::OnFileOpen(uv_fs_t *req) uv_strerror_r((int)req->result, buf, bufSize); thisClass->LogMsg(MSG_FAIL, "Error opening file: %s, path:%s", buf, context->localPath.c_str()); - WRITE_LOG(LOG_FATAL, "open path:%s error:%s", context->localPath.c_str(), buf); + WRITE_LOG(LOG_FATAL, "open path:%s error:%s, dir:%d, master:%d", + context->localPath.c_str(), buf, context->isDir, context->master); OnFileOpenFailed(context); return; } @@ -716,6 +723,7 @@ bool HdcTransferBase::RecvIOPayload(CtxFile *context, uint8_t *data, int dataSiz break; } if (SimpleFileIO(context, pld.index, clearBuf, clearSize) < 0) { + WRITE_LOG(LOG_WARN, "RecvIOPayload SimpleFileIO fail."); break; } ret = true;