瀏覽代碼

Z991239-4900 #comment 同步代码

Signed-Off-By: commit-hook
刘文涛80174520 2 年之前
父節點
當前提交
8cd0ef604a
共有 3 個文件被更改,包括 27 次插入7 次删除
  1. 11 0
      Module/mod_upload/UploadFSM.cpp
  2. 1 0
      Module/mod_upload/mod_upload.cpp
  3. 15 7
      Module/mod_upload/mod_upload.h

+ 11 - 0
Module/mod_upload/UploadFSM.cpp

@@ -1835,8 +1835,15 @@ bool UploadFSM::getFileContent(FILE* pFile,unsigned char* content,int beginPos,
 	if(pFile==NULL||content==NULL){
 		return false;
 	}
+#ifdef RVC_OS_WIN
+	clearerr(pFile);//尝试先复位错误指针
+#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());
+#else
 		DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("getFileContent")("getFileContent fail,fseek beginPos =%d is error =%d",beginPos, errno);
+#endif
 		return false;
 	}
 	unsigned char* pRead = content;//移动的指针
@@ -1858,7 +1865,11 @@ bool UploadFSM::getFileContent(FILE* pFile,unsigned char* content,int beginPos,
 		return true;
 	}else{
 		//Dbg("getFileContent fail,pRemaind =%d",pRemaind);
+#ifdef RVC_OS_WIN
+		DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("getFileContent")("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);
+#endif	
 		return false;
 	}
 }

+ 1 - 0
Module/mod_upload/mod_upload.cpp

@@ -1,3 +1,4 @@
+#include "stdafx.h"
 #include "mod_upload.h"
 
 

+ 15 - 7
Module/mod_upload/mod_upload.h

@@ -4,9 +4,11 @@
 #include "stdafx.h"
 #include "SpBase.h"
 #include "SpIni.h"
-
+#ifdef RVC_OS_WIN
+#else
 #include "SpTest.h"
 #include "modVer.h"
+#endif
 
 #include "UploadFSM.h"
 #include "Upload_server_g.h"
@@ -37,13 +39,15 @@ public:
 	virtual ~CUploadEntity() {}
 	virtual const char* GetEntityName() const { return "Upload"; }
 	virtual bool IsService()const { return true; }
+#ifdef RVC_OS_WIN
+#else
 	const char* GetEntityVersion() const override
 	{
 		return MODULE_VERSION_FULL;
 	}
 
 	ON_ENTITYT_TEST()
-
+#endif
 	virtual void OnPreStart(CAutoArray<CSimpleStringA> strArgs, CSmartPointer<ITransactionContext> pTransactionContext)
 	{
 		ErrorCodeEnum Error = Error_Succeed;
@@ -84,20 +88,22 @@ public:
 		ctx->Ans.uploadState = 2;
 		ctx->Ans.uploadNumber = 0;
 		ctx->Ans.elapseTime = CSimpleStringA2W("");
-		Dbg("UploadProgess is disable");
+		//Dbg("UploadProgess is disable");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("UploadProgess")("UploadProgess is disable");
 		return ret;
 	}
 	//查询剩余待上传的文件个数
 	ErrorCodeEnum UploadNumber(SpReqAnsContext<UploadService_UploadNumber_Req, UploadService_UploadNumber_Ans>::Pointer ctx)
 	{
 		ErrorCodeEnum  ret = Error_Succeed;
-		Dbg("UploadNumber req silentTime is %d", ctx->Req.silentTime);
+		//Dbg("UploadNumber req silentTime is %d",ctx->Req.silentTime);
 		//废弃接口
 		//int fileNum = m_fsm.getCheckDirFile(ctx->Req.silentTime);
 		//Dbg("UploadNumber is %d",fileNum);
 		//ctx->Ans.uploadNumber=fileNum;
 		ctx->Ans.uploadNumber = 0;
-		Dbg("UploadNumber is disable");
+		//Dbg("UploadNumber is disable");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("UploadNumber")("UploadNumber is disable");
 		return ret;
 	}
 
@@ -113,7 +119,8 @@ public:
 		//	ctx->Ans.uploadDateStr=str;
 		//}
 		ctx->Ans.uploadDateStr = str;
-		Dbg("UploadDateList is disable");
+		//Dbg("UploadDateList is disable");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("UploadDateList")("UploadDateList is disable");
 		return ret;
 	}
 
@@ -128,7 +135,8 @@ public:
 		//}else{
 		//	ctx->Ans.isOK=false;
 		//}
-		Dbg("ClearUploadDate is disable");
+		//Dbg("ClearUploadDate is disable");
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("ClearUploadDate")("ClearUploadDate is disable");
 		ctx->Ans.isOK = true;
 		return ret;
 	}