|
@@ -156,12 +156,12 @@ namespace Task
|
|
|
{
|
|
|
reqUrl = it->second;
|
|
|
}else{
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("uploadFile")("uploadFile is fail ,branchIp[%d] is null",branchSeq);
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("uploadFile is fail ,branchIp[%d] is null",branchSeq);
|
|
|
errmsg = CSimpleStringA::Format("uploadFile is fail ,branchIp[%d] is null",branchSeq).GetData();
|
|
|
return false;
|
|
|
}
|
|
|
}else{
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("uploadFile")("uploadFile is fail ,branchIp is null");
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("uploadFile is fail ,branchIp is null");
|
|
|
errmsg = "uploadFile is fail ,branchIp is null";
|
|
|
return false;
|
|
|
}
|
|
@@ -185,13 +185,13 @@ namespace Task
|
|
|
|
|
|
if(uploadedLen>m_fsm->m_currUploadFile->fileLen){
|
|
|
//服务器返回长度大于终端文件长度
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("uploadFile")("uploadFile is fail, server filelen [%d] is over terminal filelen [%d]",uploadedLen,m_fsm->m_currUploadFile->fileLen);
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("uploadFile is fail, server filelen [%d] is over terminal filelen [%d]",uploadedLen,m_fsm->m_currUploadFile->fileLen);
|
|
|
errmsg=CSimpleStringA::Format("uploadFile is fail, server filelen [%d] is over terminal filelen [%d]",uploadedLen,m_fsm->m_currUploadFile->fileLen).GetData();
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
if (uploadedLen < 0) {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("uploadFile")("uploadFile uploadedLen beginPos < 0");
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("uploadFile uploadedLen beginPos < 0");
|
|
|
errmsg = CSimpleStringA::Format("uploadFile is fail, server filelen [%d] is <0", uploadedLen).GetData();
|
|
|
return false;
|
|
|
}
|
|
@@ -210,19 +210,19 @@ namespace Task
|
|
|
// }
|
|
|
// else {
|
|
|
// uploadedLen = 0;//重传服务器临时文件删除
|
|
|
- // DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("uploadFile")("文件[%s] 不是新上传文件,重新从0位置上传", m_fsm->m_currUploadFile->filePath.c_str());
|
|
|
+ // DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("文件[%s] 不是新上传文件,重新从0位置上传", m_fsm->m_currUploadFile->filePath.c_str());
|
|
|
// }
|
|
|
// }
|
|
|
//}
|
|
|
|
|
|
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("uploadFile")("文件[%s] 开始传送位置 uploadedLen = %d, file len=%d",m_fsm->m_currUploadFile->filePath.c_str(), uploadedLen, m_fsm->m_currUploadFile->fileLen);
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("文件[%s] 开始传送位置 uploadedLen = %d, file len=%d",m_fsm->m_currUploadFile->filePath.c_str(), uploadedLen, m_fsm->m_currUploadFile->fileLen);
|
|
|
|
|
|
//循环传送数据块
|
|
|
FILE* pFile =fopen(m_fsm->m_currUploadFile->filePath.c_str(),"rb");
|
|
|
if(pFile==NULL){
|
|
|
//读取文件失败;
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("uploadFile")("uploadFile is fail, file open fail");
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("uploadFile is fail, file open fail");
|
|
|
errmsg="uploadFile is fail, file open fail";
|
|
|
return false;
|
|
|
}
|
|
@@ -297,13 +297,13 @@ namespace Task
|
|
|
}
|
|
|
}
|
|
|
if(uploadSucc){
|
|
|
- //DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("uploadFile")("uploadFile succ");
|
|
|
+ //DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("uploadFile succ");
|
|
|
}else{
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("uploadFile")("uploadFile fail url=%s",reqUrl.c_str());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("uploadFile fail url=%s",reqUrl.c_str());
|
|
|
}
|
|
|
if(pFile){
|
|
|
if(fclose(pFile)!=0){
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("uploadFile")("uploadFile fail, close file fail ,url=%s",reqUrl.c_str());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("uploadFile fail, close file fail ,url=%s",reqUrl.c_str());
|
|
|
errmsg="uploadFile fail, close file fail";
|
|
|
return false;
|
|
|
}
|
|
@@ -348,11 +348,11 @@ namespace Task
|
|
|
//qTempReq.m_printDbg=true;
|
|
|
//调用上传接口
|
|
|
if(!client->UploadFileBlock(qTempReq,qTempRet)){
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("uploadFileImpl")("uploadFile http req fail ,url =%s ,fileName = %s",httpUrl.c_str(), m_fsm->m_currUploadFile->fileName.c_str());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("uploadFile http req fail ,url =%s ,fileName = %s",httpUrl.c_str(), m_fsm->m_currUploadFile->fileName.c_str());
|
|
|
return false;
|
|
|
}
|
|
|
if(qTempRet.httpCode!=200){
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("uploadFileImpl")("uploadFile http req fail ,url =%s ,retHttpCode=%d, fileName = %s",httpUrl.c_str(), qTempRet.httpCode, m_fsm->m_currUploadFile->fileName.c_str());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("uploadFile http req fail ,url =%s ,retHttpCode=%d, fileName = %s",httpUrl.c_str(), qTempRet.httpCode, m_fsm->m_currUploadFile->fileName.c_str());
|
|
|
return false;
|
|
|
}
|
|
|
//解析回应报文
|
|
@@ -360,7 +360,7 @@ namespace Task
|
|
|
Json::Value rootRet;
|
|
|
if (!reader.parse(qTempRet.strBody, rootRet, false))
|
|
|
{
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("uploadFileImpl")("uploadFile http parse resp is fail,fileName = %s",m_fsm->m_currUploadFile->fileName.c_str());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("uploadFile http parse resp is fail,fileName = %s",m_fsm->m_currUploadFile->fileName.c_str());
|
|
|
return false;//解析失败
|
|
|
}
|
|
|
uploadData.strBody = qTempRet.strBody;
|
|
@@ -372,12 +372,12 @@ namespace Task
|
|
|
uploadData.branchFilePath = rootRet["data"]["branch_file_path"].asCString();
|
|
|
return true;//返回值
|
|
|
}else{
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("uploadFileImpl")("uploadFile http [success][data] is invaild ,url =%s, fileName = %s",httpUrl.c_str(),m_fsm->m_currUploadFile->fileName.c_str());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("uploadFile http [success][data] is invaild ,url =%s, fileName = %s",httpUrl.c_str(),m_fsm->m_currUploadFile->fileName.c_str());
|
|
|
return false;//无data字段
|
|
|
}
|
|
|
}else{
|
|
|
//失败
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("uploadFileImpl")("uploadFile http [success] is false, url[%s],userCode[%s],errmsg[%s],fileName = %s",httpUrl.c_str(),qTempRet.m_userCode.c_str(),qTempRet.m_errMsg.c_str(),m_fsm->m_currUploadFile->fileName.c_str());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("uploadFile http [success] is false, url[%s],userCode[%s],errmsg[%s],fileName = %s",httpUrl.c_str(),qTempRet.m_userCode.c_str(),qTempRet.m_errMsg.c_str(),m_fsm->m_currUploadFile->fileName.c_str());
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
@@ -402,7 +402,7 @@ namespace Task
|
|
|
qTempReq.m_url=m_fsm->m_centerUrl.queryTempFileUrl;//访问地址
|
|
|
|
|
|
if(!client->Post(qTempReq, qTempRet)){
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("queryTempFile")("queryTempFile http req fail ,fileName = %s, err=%s",m_fsm->m_currUploadFile->filePath.c_str(),qTempRet.m_errMsg.c_str());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("queryTempFile http req fail ,fileName = %s, err=%s",m_fsm->m_currUploadFile->filePath.c_str(),qTempRet.m_errMsg.c_str());
|
|
|
return false;
|
|
|
}
|
|
|
//解析报文
|
|
@@ -411,7 +411,7 @@ namespace Task
|
|
|
Json::Value rootRet;
|
|
|
if (!reader.parse(qTempRet.m_retStr, rootRet, false))
|
|
|
{
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("queryTempFile")("queryTempFile parse resp is fail,fileName = %s",m_fsm->m_currUploadFile->filePath.c_str());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("queryTempFile parse resp is fail,fileName = %s",m_fsm->m_currUploadFile->filePath.c_str());
|
|
|
m_fsm->m_uploadReport.queryTempFail++;//添加查询临时失败计数
|
|
|
return false;//解析失败
|
|
|
}
|
|
@@ -428,7 +428,7 @@ namespace Task
|
|
|
return false;//无data字段
|
|
|
}
|
|
|
}else{
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("queryTempFile")("queryTempFile [success] is false, fileName = %s",m_fsm->m_currUploadFile->filePath.c_str());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("queryTempFile [success] is false, fileName = %s",m_fsm->m_currUploadFile->filePath.c_str());
|
|
|
m_fsm->m_uploadReport.queryTempFail++;//添加查询临时失败计数
|
|
|
return false;
|
|
|
|
|
@@ -470,7 +470,7 @@ namespace Task
|
|
|
updateStateReq.m_url=m_fsm->m_centerUrl.updateStateUrl;//访问地址
|
|
|
|
|
|
if(!client->Post(updateStateReq, updateStateRet)){
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("updateState")("updateState is fail, userCode = %s, errmsg = %s",updateStateRet.m_userCode.c_str(), updateStateRet.m_errMsg.c_str());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("updateState is fail, userCode = %s, errmsg = %s",updateStateRet.m_userCode.c_str(), updateStateRet.m_errMsg.c_str());
|
|
|
errmsg = CSimpleStringA::Format("updateState is fail, userCode = %s, errmsg = %s",updateStateRet.m_userCode.c_str(), updateStateRet.m_errMsg.c_str());
|
|
|
return false;
|
|
|
}
|
|
@@ -532,7 +532,7 @@ namespace Task
|
|
|
updateFailReq.m_url = m_fsm->m_centerUrl.addUploadFailUrl;//访问地址
|
|
|
|
|
|
if(!client->Post(updateFailReq, updateFailRet)){
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("addUploadFail")("addUploadFail is fail,userCode = %s",updateFailRet.m_userCode.c_str());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("addUploadFail is fail,userCode = %s",updateFailRet.m_userCode.c_str());
|
|
|
return false;
|
|
|
}
|
|
|
//解析报文
|
|
@@ -555,7 +555,7 @@ namespace Task
|
|
|
return false;//无data字段
|
|
|
}
|
|
|
}else{
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("addUploadFail")("addUploadFail [success] is false");
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("addUploadFail [success] is false");
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
@@ -566,27 +566,27 @@ namespace Task
|
|
|
|
|
|
#ifdef RVC_OS_WIN
|
|
|
if(remove(m_fsm->m_currUploadFile->filePath.c_str())==0){
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("operateFile")("delete file is ok, file =%s",m_fsm->m_currUploadFile->filePath.c_str());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("delete file is ok, file =%s",m_fsm->m_currUploadFile->filePath.c_str());
|
|
|
return true;
|
|
|
}else{
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("operateFile")("delete file is error, file =%s, errno=%d",m_fsm->m_currUploadFile->filePath.c_str(),(int)GetLastError());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("delete file is error, file =%s, errno=%d",m_fsm->m_currUploadFile->filePath.c_str(),(int)GetLastError());
|
|
|
errmsg = CSimpleStringA::Format("delete file is error, file =%s, errno=%d",m_fsm->m_currUploadFile->filePath.c_str(),(int)GetLastError());
|
|
|
return false;
|
|
|
}
|
|
|
#else
|
|
|
if (changeFileAtt(m_fsm->m_currUploadFile->filePath.c_str()) == 0) {
|
|
|
if (remove(m_fsm->m_currUploadFile->filePath.c_str()) == 0) {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("operateFile")("delete file is ok, file =%s",m_fsm->m_currUploadFile->filePath.c_str());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("delete file is ok, file =%s",m_fsm->m_currUploadFile->filePath.c_str());
|
|
|
return true;
|
|
|
}
|
|
|
else {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("operateFile")("delete file is error,file =%s, errno=%d",m_fsm->m_currUploadFile->filePath.c_str(), errno);
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("delete file is error,file =%s, errno=%d",m_fsm->m_currUploadFile->filePath.c_str(), errno);
|
|
|
errmsg = CSimpleStringA::Format("delete file is error, file =%s, errno=%d",m_fsm->m_currUploadFile->filePath.c_str(), errno);
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("operateFile")("delete file is error,changefileAtt fail,file =%s, errno=%d",m_fsm->m_currUploadFile->filePath.c_str(), errno);
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("delete file is error,changefileAtt fail,file =%s, errno=%d",m_fsm->m_currUploadFile->filePath.c_str(), errno);
|
|
|
errmsg = CSimpleStringA::Format("delete file is error,changefileAtt fail,file =%s, errno=%d",m_fsm->m_currUploadFile->filePath.c_str(), errno);
|
|
|
return false;
|
|
|
}
|
|
@@ -612,14 +612,14 @@ namespace Task
|
|
|
destDir = m_fsm->m_currUploadFile->after_deal_text;
|
|
|
}
|
|
|
string srcPath = m_fsm->m_currUploadFile->filePath;
|
|
|
- //DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("operateFile")("move file %s to %s",srcPath.c_str(),destPath.c_str());
|
|
|
+ //DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("move file %s to %s",srcPath.c_str(),destPath.c_str());
|
|
|
//判断是否存在目标文件,如存在,则先删除
|
|
|
#ifdef RVC_OS_WIN
|
|
|
if(ExistsFileA(destPath.c_str())){
|
|
|
if(remove(destPath.c_str())==0){
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("operateFile")("delete dest file is ok [%s]",destPath.c_str());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("delete dest file is ok [%s]",destPath.c_str());
|
|
|
}else{
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("operateFile")("delete dest file is error, errno=%d, [%s]",(int)GetLastError(),destPath.c_str());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("delete dest file is error, errno=%d, [%s]",(int)GetLastError(),destPath.c_str());
|
|
|
errmsg = CSimpleStringA::Format("delete dest file is error, errno=%d, [%s]",(int)GetLastError(),destPath.c_str());
|
|
|
return false;
|
|
|
}
|
|
@@ -627,7 +627,7 @@ namespace Task
|
|
|
//判断移动目标文件夹是否存在,不存在,则创建
|
|
|
if(!ExistsDirA(destDir.c_str())){
|
|
|
if(!CreateDirRecursiveA(destDir.c_str())){
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("operateFile")("create dest dir [%s] is error, errno=%d",destDir.c_str(),GetLastError());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("create dest dir [%s] is error, errno=%d",destDir.c_str(),GetLastError());
|
|
|
errmsg = CSimpleStringA::Format("create dest dir [%s] is error, errno=%d",destDir.c_str(),GetLastError());
|
|
|
return false;
|
|
|
}
|
|
@@ -638,11 +638,11 @@ namespace Task
|
|
|
bool isSucc = false;
|
|
|
for (i = 0; i < tries; ++i) {
|
|
|
if(rename(srcPath.c_str(),destPath.c_str())==0){
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("operateFile")("move file ok! tries:%d, [%s] to [%s] ", i, srcPath.c_str(),destPath.c_str());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("move file ok! tries:%d, [%s] to [%s] ", i, srcPath.c_str(),destPath.c_str());
|
|
|
isSucc = true;
|
|
|
break;
|
|
|
} else {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("operateFile")("move file failed! errno:%d, [%s] to [%s] ", (int)GetLastError(), srcPath.c_str(),destPath.c_str());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("move file failed! errno:%d, [%s] to [%s] ", (int)GetLastError(), srcPath.c_str(),destPath.c_str());
|
|
|
errmsg = CSimpleStringA::Format("move file failed! errno:%d, [%s] to [%s] ", (int)GetLastError(), srcPath.c_str(),destPath.c_str());
|
|
|
Sleep(1000);
|
|
|
}
|
|
@@ -652,16 +652,16 @@ namespace Task
|
|
|
if (ExistsFileA(destPath.c_str())) {
|
|
|
if (changeFileAtt(destPath.c_str()) == 0) {
|
|
|
if (remove(destPath.c_str()) == 0) {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("operateFile")("delete dest file is ok [%s]",destPath.c_str());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("delete dest file is ok [%s]",destPath.c_str());
|
|
|
}
|
|
|
else {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("operateFile")("delete dest file is error, errno=%d, [%s]", errno, destPath.c_str());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("delete dest file is error, errno=%d, [%s]", errno, destPath.c_str());
|
|
|
errmsg = CSimpleStringA::Format("delete src file is error, errno=%d, [%s]", errno, destPath.c_str());
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("operateFile")("delete dest file is error,changefileAtt fail ,errno=%d , file=%s ", errno, destPath.c_str());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("delete dest file is error,changefileAtt fail ,errno=%d , file=%s ", errno, destPath.c_str());
|
|
|
errmsg = CSimpleStringA::Format("delete src file is error, changefileAtt fail, errno=%d, file=%s", errno, destPath.c_str());
|
|
|
return false;
|
|
|
}
|
|
@@ -669,7 +669,7 @@ namespace Task
|
|
|
//判断移动目标文件夹是否存在,不存在,则创建
|
|
|
if (!ExistsDirA(destDir.c_str())) {
|
|
|
if (!CreateDirRecursiveA(destDir.c_str())) {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("operateFile")("create dest dir [%s] is error, errno=%d", destDir.c_str(), errno);
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("create dest dir [%s] is error, errno=%d", destDir.c_str(), errno);
|
|
|
errmsg = CSimpleStringA::Format("create dest dir [%s] is error, errno=%d", destDir.c_str(), errno);
|
|
|
return false;
|
|
|
}
|
|
@@ -684,18 +684,18 @@ namespace Task
|
|
|
//rename函数对于跨分支的目录存在拷贝不成功的情况,故采用先拷贝后删除的操作修复此bug
|
|
|
if (fileutil_copy_file(destPath.c_str(), srcPath.c_str()) == 0) {
|
|
|
if (remove(srcPath.c_str()) == 0) {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("operateFile")("move file ok! tries:%d, [%s] to [%s] ", i, srcPath.c_str(),destPath.c_str());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("move file ok! tries:%d, [%s] to [%s] ", i, srcPath.c_str(),destPath.c_str());
|
|
|
isSucc = true;
|
|
|
break;
|
|
|
}
|
|
|
else {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("operateFile")("move file failed! errno:%d, [%s] to [%s] ", errno, srcPath.c_str(),destPath.c_str());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("move file failed! errno:%d, [%s] to [%s] ", errno, srcPath.c_str(),destPath.c_str());
|
|
|
errmsg = CSimpleStringA::Format("move file failed! errno:%d, [%s] to [%s] ", errno, srcPath.c_str(),destPath.c_str());
|
|
|
Sleep(1000);
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("operateFile")("move file failed! copy src file fail, errno:%d, [%s] to [%s] ", errno, srcPath.c_str(),destPath.c_str());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("move file failed! copy src file fail, errno:%d, [%s] to [%s] ", errno, srcPath.c_str(),destPath.c_str());
|
|
|
errmsg = CSimpleStringA::Format("move file failed! copy src file fail, errno:%d, [%s] to [%s] ", errno, srcPath.c_str(),destPath.c_str());
|
|
|
Sleep(1000);
|
|
|
}
|
|
@@ -703,7 +703,7 @@ namespace Task
|
|
|
return isSucc;
|
|
|
}
|
|
|
else {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("operateFile")("move file failed! changefileAtt fail, errno:%d, [%s] to [%s] ", errno, srcPath.c_str(),destPath.c_str());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("move file failed! changefileAtt fail, errno:%d, [%s] to [%s] ", errno, srcPath.c_str(),destPath.c_str());
|
|
|
errmsg = CSimpleStringA::Format("move file failed! changefileAtt fail, errno:%d, [%s] to [%s] ", errno, srcPath.c_str(),destPath.c_str());
|
|
|
return false;
|
|
|
}
|
|
@@ -711,7 +711,7 @@ namespace Task
|
|
|
}else if(m_fsm->m_currUploadFile->after_deal_type=="N"){
|
|
|
return true;
|
|
|
}else{
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("operateFile")("file [%s] invalid after_deal_type=%s",m_fsm->m_currUploadFile->fileName.c_str(),m_fsm->m_currUploadFile->after_deal_type.c_str());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("file [%s] invalid after_deal_type=%s",m_fsm->m_currUploadFile->fileName.c_str(),m_fsm->m_currUploadFile->after_deal_type.c_str());
|
|
|
errmsg = CSimpleStringA::Format("invalid after_deal_type=%s",m_fsm->m_currUploadFile->after_deal_type.c_str());
|
|
|
return false;
|
|
|
}
|
|
@@ -721,20 +721,20 @@ namespace Task
|
|
|
|
|
|
void UploadFSM::OnStateTrans( int iSrcState, int iDstState )
|
|
|
{
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("OnStateTrans")("trans from %s to %s", GetStateName(iSrcState), GetStateName(iDstState));
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("trans from %s to %s", GetStateName(iSrcState), GetStateName(iDstState));
|
|
|
|
|
|
}
|
|
|
|
|
|
void UploadFSM::OnSysVarEvent( const char *pszKey, const char *pszValue,const char *pszOldValue,const char *pszEntityName )
|
|
|
{
|
|
|
- //DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("OnSysVarEvent")("rx sysvar %s from %s, %s to %s", pszKey, pszEntityName, pszOldValue, pszValue);
|
|
|
+ //DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM)("rx sysvar %s from %s, %s to %s", pszKey, pszEntityName, pszOldValue, pszValue);
|
|
|
if (pszValue[0] == 'O') {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("OnSysVarEvent")("rx sysvar %s from %s, %s to %s", pszKey, pszEntityName, pszOldValue, pszValue);
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("rx sysvar %s from %s, %s to %s", pszKey, pszEntityName, pszOldValue, pszValue);
|
|
|
m_isOffLine = true;
|
|
|
PostEventFIFO(new FSMEvent(USER_EVT_JMP_ENABLE));
|
|
|
} else {
|
|
|
if (m_isOffLine) {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("OnSysVarEvent")("rx sysvar %s from %s, %s to %s", pszKey, pszEntityName, pszOldValue, pszValue);
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("rx sysvar %s from %s, %s to %s", pszKey, pszEntityName, pszOldValue, pszValue);
|
|
|
}
|
|
|
m_isOffLine = false;
|
|
|
PostEventFIFO(new FSMEvent(USER_EVT_JMP_DISABLE));
|
|
@@ -754,14 +754,14 @@ ErrorCodeEnum UploadFSM::OnInit()
|
|
|
if(Error==Error_Succeed){
|
|
|
//获取模式控制参数
|
|
|
m_centerModel = (int)centerModel;//强制总行模式
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("OnInit")("model is centerModel, CenterModel = %d", m_centerModel);
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("model is centerModel, CenterModel = %d", m_centerModel);
|
|
|
|
|
|
//增加总行接口Url参数
|
|
|
CSimpleStringA str="";
|
|
|
Error = spConfig->ReadConfigValue("upload", "QueryPlanUrl", str);
|
|
|
if (Error == Error_Succeed)
|
|
|
{
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("OnInit")("[CenterUrl] QueryPlanUrl =%s",str.GetData());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM)("[CenterUrl] QueryPlanUrl =%s",str.GetData());
|
|
|
m_centerUrl.queryPlanUrl = str.GetData();
|
|
|
}
|
|
|
else
|
|
@@ -772,7 +772,7 @@ ErrorCodeEnum UploadFSM::OnInit()
|
|
|
Error = spConfig->ReadConfigValue("upload", "QueryTempFileUrl", str);
|
|
|
if (Error == Error_Succeed)
|
|
|
{
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("OnInit")("[CenterUrl] QueryTempFileUrl =%s",str.GetData());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM)("[CenterUrl] QueryTempFileUrl =%s",str.GetData());
|
|
|
m_centerUrl.queryTempFileUrl = str.GetData();
|
|
|
}
|
|
|
else
|
|
@@ -783,7 +783,7 @@ ErrorCodeEnum UploadFSM::OnInit()
|
|
|
Error = spConfig->ReadConfigValue("upload", "UpdateStateUrl", str);
|
|
|
if (Error == Error_Succeed)
|
|
|
{
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("OnInit")("[CenterUrl] UpdateStateUrl =%s",str.GetData());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM)("[CenterUrl] UpdateStateUrl =%s",str.GetData());
|
|
|
m_centerUrl.updateStateUrl = str.GetData();
|
|
|
}
|
|
|
else
|
|
@@ -794,7 +794,7 @@ ErrorCodeEnum UploadFSM::OnInit()
|
|
|
Error = spConfig->ReadConfigValue("upload", "AddUploadFailUrl", str);
|
|
|
if (Error == Error_Succeed)
|
|
|
{
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("OnInit")("[CenterUrl] AddUploadFailUrl =%s",str.GetData());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM)("[CenterUrl] AddUploadFailUrl =%s",str.GetData());
|
|
|
m_centerUrl.addUploadFailUrl = str.GetData();
|
|
|
}
|
|
|
else
|
|
@@ -805,7 +805,7 @@ ErrorCodeEnum UploadFSM::OnInit()
|
|
|
Error = spConfig->ReadConfigValue("upload", "EachUploadLen", str);
|
|
|
if (Error == Error_Succeed)
|
|
|
{
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("OnInit")("[CenterUrl] EachUploadLen =%s",str.GetData());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM)("[CenterUrl] EachUploadLen =%s",str.GetData());
|
|
|
if(str.IsNullOrEmpty()){
|
|
|
m_eachUploadLen = UPLOAD_CONTENT_EACH_LEN;
|
|
|
}else{
|
|
@@ -822,7 +822,7 @@ ErrorCodeEnum UploadFSM::OnInit()
|
|
|
Error = spConfig->ReadConfigValueInt("upload", "UploadMaxNum", uploadMaxNum);
|
|
|
if (Error == Error_Succeed)
|
|
|
{
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("OnInit")("[CenterUrl] UploadMaxNum =%d",uploadMaxNum);
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM)("[CenterUrl] UploadMaxNum =%d",uploadMaxNum);
|
|
|
if(uploadMaxNum<=10){
|
|
|
m_uploadMaxNum = 200;
|
|
|
}else{
|
|
@@ -839,7 +839,7 @@ ErrorCodeEnum UploadFSM::OnInit()
|
|
|
//Error = spConfig->ReadConfigValueInt("upload", "ContinueUpload", continueUpload);
|
|
|
//if (Error == Error_Succeed)
|
|
|
//{
|
|
|
- // DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("OnInit")("[CenterUrl] ContinueUpload =%d", continueUpload);
|
|
|
+ // DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("[CenterUrl] ContinueUpload =%d", continueUpload);
|
|
|
// m_continueUpload = continueUpload;
|
|
|
//}
|
|
|
//else
|
|
@@ -860,13 +860,13 @@ ErrorCodeEnum UploadFSM::OnInit()
|
|
|
#endif
|
|
|
|
|
|
m_rootPath = runPathStr.substr(0,pos);
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("OnInit")("get rvc path is %s",m_rootPath.c_str());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM)("get rvc path is %s",m_rootPath.c_str());
|
|
|
}else{
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("OnInit")("get rvc path is null");
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM)("get rvc path is null");
|
|
|
return Error_Unexpect;
|
|
|
}
|
|
|
}else{
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("OnInit")("get rvc path is error");
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM)("get rvc path is error");
|
|
|
return Error_Unexpect;
|
|
|
}
|
|
|
|
|
@@ -1255,7 +1255,6 @@ unsigned int UploadFSM::s7_on_event(FSMEvent* event)
|
|
|
//通过
|
|
|
bool UploadFSM::queryPlan()
|
|
|
{
|
|
|
-// DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("queryPlan")("queryPlan begin");
|
|
|
IHttpFunc* client;
|
|
|
client = create_http(HttpsLogCallBack);
|
|
|
|
|
@@ -1295,7 +1294,7 @@ bool UploadFSM::queryPlan()
|
|
|
Json::Value rootRet;
|
|
|
if (!reader.parse(planRet.m_retStr, rootRet, false))
|
|
|
{
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("queryPlan")("queryPlan parse resp is fail");
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("queryPlan parse resp is fail");
|
|
|
return false;//解析失败,走旧模式
|
|
|
}
|
|
|
bool isSucc = rootRet["success"].asBool();
|
|
@@ -1310,13 +1309,13 @@ bool UploadFSM::queryPlan()
|
|
|
string bUploadUrl = rootRet["data"]["upload_address"]["upload_url"][i].asString();
|
|
|
m_branchIpList[i+1]=bUploadUrl;
|
|
|
if(!bUploadUrl.empty()){
|
|
|
- // DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("queryPlan")("queryPlan return upload_url=%s",bUploadUrl.c_str());
|
|
|
+ // DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("queryPlan return upload_url=%s",bUploadUrl.c_str());
|
|
|
}else{
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("queryPlan")("queryPlan return upload_url=");
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("queryPlan return upload_url=");
|
|
|
}
|
|
|
}
|
|
|
}else{
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("queryPlan")("[data][upload_address][upload_url] is null");
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("[data][upload_address][upload_url] is null");
|
|
|
}
|
|
|
string env = "";//上传服务器地址属于行内还是行外
|
|
|
if(rootRet["data"]["upload_address"].isMember("env")){
|
|
@@ -1395,20 +1394,20 @@ bool UploadFSM::queryPlan()
|
|
|
}
|
|
|
|
|
|
if(m_uploadPlanList->size()==0){
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("queryPlan")("queryPlan return %d plan ",m_uploadPlanList->size());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("queryPlan return %d plan ",m_uploadPlanList->size());
|
|
|
return true;//等待下一次请求,走新模式
|
|
|
}
|
|
|
return true;//明确走新模式
|
|
|
}else{
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("queryPlan")("queryPlan return [data].[mode] is false");
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("queryPlan return [data].[mode] is false");
|
|
|
return false;//明确走旧模式
|
|
|
}
|
|
|
}else{
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("queryPlan")("queryPlan return data is null");
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("queryPlan return data is null");
|
|
|
return false;//无data字段,走旧模式
|
|
|
}
|
|
|
}else{
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("queryPlan")("queryPlan return success is false");
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("queryPlan return success is false");
|
|
|
return false;//服务返回错误,走旧模式
|
|
|
}
|
|
|
}
|
|
@@ -1430,11 +1429,11 @@ void UploadFSM::scanFile()
|
|
|
path=up->path_name;
|
|
|
|
|
|
}else{
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("scanFile")("plan path_type is invalid path_type=%s",up->path_type.c_str());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("plan path_type is invalid path_type=%s",up->path_type.c_str());
|
|
|
continue;
|
|
|
}
|
|
|
if(m_printPlan){
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("scanFile")("planID=[%s], scanDir=[%s], filter=[%s], file_limit=[%d], max_silent=[%d]",up->plan_id.c_str(),path.c_str(),up->file_name.c_str(),up->file_limit,up->max_silent);
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("planID=[%s], scanDir=[%s], filter=[%s], file_limit=[%d], max_silent=[%d]",up->plan_id.c_str(),path.c_str(),up->file_name.c_str(),up->file_limit,up->max_silent);
|
|
|
}
|
|
|
scanDirfresh(up,path.c_str());
|
|
|
}
|
|
@@ -1473,7 +1472,7 @@ void UploadFSM::scanDirfresh(UploadPlan* plan,const char *path)
|
|
|
//最后修改时间间隔过滤
|
|
|
WIN32_FILE_ATTRIBUTE_DATA attr;
|
|
|
if (!GetFileAttributesExA(file_path, GetFileExInfoStandard, &attr)) {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("scanDirfresh")("get local file attrr fail! file_path=%s",file_path);
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("get local file attrr fail! file_path=%s",file_path);
|
|
|
continue;//继续下一个文件
|
|
|
}
|
|
|
//判断文件是否超过最大扫描文件长度
|
|
@@ -1511,7 +1510,7 @@ void UploadFSM::scanDirfresh(UploadPlan* plan,const char *path)
|
|
|
#else
|
|
|
struct stat attr_of_src;
|
|
|
if (lstat(file_path, &attr_of_src) != 0) {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("scanDirfresh")("get local file attrr fail! file_path=%s", file_path);
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("get local file attrr fail! file_path=%s", file_path);
|
|
|
continue;//继续下一个文件
|
|
|
}
|
|
|
//判断文件是否超过最大扫描文件长度
|
|
@@ -1587,7 +1586,7 @@ void UploadFSM::scanDirfresh(UploadPlan* plan,const char *path)
|
|
|
upFile->upload_address_env = plan->upload_address_env;
|
|
|
|
|
|
m_uploadList->push_back(upFile);
|
|
|
- //DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("scanDirfresh")("file %s lenth(%d) added!",file_path,filelen);
|
|
|
+ //DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("file %s lenth(%d) added!",file_path,filelen);
|
|
|
}
|
|
|
toolkit_array_free2(arr_files);
|
|
|
}
|
|
@@ -1604,7 +1603,7 @@ void UploadFSM::scanDirfresh(UploadPlan* plan,const char *path)
|
|
|
void UploadFSM::HttpsLogCallBack(const char* logtxt)
|
|
|
{
|
|
|
if(logtxt!=NULL){
|
|
|
- DbgWithLink(LOG_LEVEL_DEBUG,LOG_TYPE_SYSTEM).setAPI("HttpsLogCallBack")("http dbg: %s",logtxt);
|
|
|
+ DbgWithLink(LOG_LEVEL_DEBUG,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("http dbg: %s",logtxt);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1681,20 +1680,20 @@ ErrorCodeEnum UploadFSM::SM3FileToStr(CSimpleStringA strFilePath, CSimpleStringA
|
|
|
delete pchar;
|
|
|
//获取16进制的字符串
|
|
|
if(Error_Succeed!=SM3_Str(strSM3,md5,isSub)){
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("SM3FileToStr")("sm3国密转16进制字符串失败,file=%s",strFilePath.GetData());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("sm3国密转16进制字符串失败,file=%s",strFilePath.GetData());
|
|
|
return Error_Unexpect;
|
|
|
}
|
|
|
return Error_Succeed;
|
|
|
}else{
|
|
|
delete pchar;
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("SM3FileToStr")("sm3国密加密失败,file=%s",strFilePath.GetData());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("sm3国密加密失败,file=%s",strFilePath.GetData());
|
|
|
return Error_Unexpect;
|
|
|
}
|
|
|
}
|
|
|
catch (...)
|
|
|
{
|
|
|
delete pchar;
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("SM3FileToStr")("sm3国密加密异常失败,file=%s",strFilePath.GetData());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("sm3国密加密异常失败,file=%s",strFilePath.GetData());
|
|
|
return Error_Exception;
|
|
|
}
|
|
|
}
|
|
@@ -1747,9 +1746,9 @@ bool UploadFSM::getFileContent(FILE* pFile,unsigned char* content,int beginPos,
|
|
|
#endif
|
|
|
if(fseek(pFile,beginPos,SEEK_SET)!=0){
|
|
|
#ifdef RVC_OS_WIN
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("getFileContent")("getFileContent fail,fseek beginPos =%d is error =%d",beginPos,(int)GetLastError());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("getFileContent fail,fseek beginPos =%d is error =%d",beginPos,(int)GetLastError());
|
|
|
#else
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("getFileContent")("getFileContent fail,fseek beginPos =%d is error =%d",beginPos, errno);
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("getFileContent fail,fseek beginPos =%d is error =%d",beginPos, errno);
|
|
|
#endif
|
|
|
return false;
|
|
|
}
|
|
@@ -1772,9 +1771,9 @@ bool UploadFSM::getFileContent(FILE* pFile,unsigned char* content,int beginPos,
|
|
|
}else{
|
|
|
|
|
|
#ifdef RVC_OS_WIN
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("getFileContent")("getFileContent fail,pRemaind =%d, error=%d",pRemaind,(int)GetLastError());
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("getFileContent fail,pRemaind =%d, error=%d",pRemaind,(int)GetLastError());
|
|
|
#else
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("getFileContent")("getFileContent fail,pRemaind =%d, error=%d",pRemaind, errno);
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("getFileContent fail,pRemaind =%d, error=%d",pRemaind, errno);
|
|
|
#endif
|
|
|
return false;
|
|
|
}
|
|
@@ -1831,7 +1830,7 @@ bool UploadFSM::GetFileLength(const char* filePath,long &fileLen)
|
|
|
return true;
|
|
|
}
|
|
|
else {
|
|
|
- DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("GetFileLength")("fseek file=%s is fail, err=%d", filePath,errno);
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("fseek file=%s is fail, err=%d", filePath,errno);
|
|
|
fclose(file);
|
|
|
return false;
|
|
|
}
|