Browse Source

Merge branch '0_0_2_test1' of http://mayun.itc.cmbchina.cn/QD_RemoteBankArea/LR04.02_RVCTerminalPlus into 0_0_2_test1

gifur 4 năm trước cách đây
mục cha
commit
53b89d758d

+ 3 - 3
Module/mod_UpgradeMgr/UpgradeMgrFSM.cpp

@@ -387,7 +387,7 @@ ErrorCodeEnum CUpgradeMgrFSM::OnInit()
 			{
 				m_DepWhitelist.push_back(arr[i]);
 			}
-			Dbg("init read [HashFilter] DepWhitelist=%s",str);
+			Dbg("init read [HashFilter] DepWhitelist=%s",str.GetData());
 		}else{
 			LogWarn(Severity_Middle, rc, ERR_READ_INI_FAIL,  "get upgradeMgr.ini DepWhitelist error");
 		}
@@ -398,7 +398,7 @@ ErrorCodeEnum CUpgradeMgrFSM::OnInit()
 			{
 				m_DirBlacklist.push_back(arr[i]);
 			}
-			Dbg("init read [HashFilter] DirBlacklist=%s",str);
+			Dbg("init read [HashFilter] DirBlacklist=%s",str.GetData());
 		}else{
 			LogWarn(Severity_Middle, rc, ERR_READ_INI_FAIL,  "get upgradeMgr.ini DirBlacklist error");
 		}
@@ -409,7 +409,7 @@ ErrorCodeEnum CUpgradeMgrFSM::OnInit()
 			{
 				m_FileBlacklist.push_back(arr[i]);
 			}
-			Dbg("init read [HashFilter] FileBlacklist=%s",str);
+			Dbg("init read [HashFilter] FileBlacklist=%s",str.GetData());
 		}else{
 			LogWarn(Severity_Middle, rc, ERR_READ_INI_FAIL,  "get upgradeMgr.ini FileBlacklist error");
 		}

+ 7 - 3
Module/mod_UpgradeMgr/mod_UpgradeMgr.cpp

@@ -528,7 +528,7 @@ ErrorCodeEnum CUpgradeMgrEntity::MD5Folder(CSimpleStringA strFolderPath,bool isD
 	{
 		return Error_Null;
 	}
-	Dbg("Start to get file hash list, dir=[%s] ", strFolderPath);
+	Dbg("Start to get file hash list, dir=[%s] ", strFolderPath.GetData());
 #ifdef RVC_OS_WIN
 	_finddata_t FileInfo;
 	CSimpleStringA strfind = strFolderPath + SPLIT_SLASH_STR+"*";
@@ -740,7 +740,7 @@ ErrorCodeEnum CUpgradeMgrEntity::MD5Folder(CSimpleStringA strFolderPath,bool isD
 			{
 				if (strFindName.IndexOf(".") == -1)
 				{
-					Dbg("%s file name is illegal", strFindName);
+					Dbg("%s file name is illegal", strFindName.GetData());
 					continue;
 				}
 				//整体黑名单文件过滤
@@ -780,7 +780,11 @@ ErrorCodeEnum CUpgradeMgrEntity::MD5Folder(CSimpleStringA strFolderPath,bool isD
 						itor++;
 					}
 					//不是白名单也不是默认so文件,不需要加入hash计算
-					if (!isWhiteFile && !strFindName.IsEndWith(".so", true)) {
+					//if (!isWhiteFile && !strFindName.IsEndWith(".so", true)) {
+					//	Dbg("WhiteFile Filter don't add to md5 list, file = [%s]", strFindName.GetData());
+					//	continue;
+					//}
+					if (!isWhiteFile && !(strFindName.IndexOf(".so")>-1)) {
 						Dbg("WhiteFile Filter don't add to md5 list, file = [%s]", strFindName.GetData());
 						continue;
 					}

+ 20 - 10
Module/mod_upload/XZipZilb.cpp

@@ -7,13 +7,15 @@ bool CreateZipFromFile(string srcFileName, string zipFileName)
 {
 	if (srcFileName.empty() || srcFileName.length() == 0 ||
 		zipFileName.empty() || zipFileName.length() == 0) {
-		Dbg("压缩文件参数为空:");
+		//Dbg("压缩文件参数为空:");
+		Dbg("XZipZilb zip param is null");
 		return false;
 	}
 	int pos = srcFileName.find_last_of(SPLIT_SLASH);
 
 	if (pos < 0) {
-		Dbg("文件路径不对:%s",srcFileName.c_str());
+		//Dbg("文件路径不对:%s",srcFileName.c_str());
+		Dbg("XZipZilb srcFileName path format is error:%s", srcFileName.c_str());
 		return false;
 	}
 	string strName(srcFileName.substr(pos + 1));
@@ -25,24 +27,28 @@ bool CreateZipFromFile(string srcFileName, string zipFileName)
 	zipFile newZipFile = zipOpen(zipFileName.c_str(), APPEND_STATUS_CREATE); //创建zip文件
 	if (newZipFile == NULL)
 	{
-		Dbg("无法创建zip文件!");
+		//Dbg("无法创建zip文件!");
+		Dbg("XZipZilb can't create zip file: %s", zipFileName.c_str());
 		return false;
 	}
 	//压缩文件
 	if (!AddFileToZip(newZipFile, strName.c_str(), srcFileName.c_str()))
 	{
-		Dbg("压缩失败: %s",zipFileName.c_str());
+		//Dbg("压缩失败: %s",zipFileName.c_str());
+		Dbg("XZipZilb zip fail: %s", zipFileName.c_str());
 		zipClose(newZipFile, NULL); 
 		if (ExistsFileA(zipFileName.c_str())) {
 			if (remove(zipFileName.c_str()) != 0) {
-				Dbg("删除临时压缩文件失败");
+				//Dbg("删除临时压缩文件失败");
+				Dbg("XZipZilb delete temp zip file is error");
 			}
 		}
 		return false;
 	}
 	//释放文件
 	zipClose(newZipFile, NULL); 
-	Dbg("压缩成功: %s", zipFileName.c_str());
+	//Dbg("压缩成功: %s", zipFileName.c_str());
+	Dbg("XZipZilb zip succ: %s", zipFileName.c_str());
 	return true;
 	
 }
@@ -74,10 +80,12 @@ bool AddFileToZip(zipFile zf, const char* fileNameInZip, const char* srcFile)
 	if (ret != ZIP_OK)
 	{
 		if (srcFile != NULL) {
-			Dbg("在zip文件中创建新文件失败: %s", srcFile);
+			//Dbg("在zip文件中创建新文件失败: %s", srcFile);
+			Dbg("XZipZilb create file in zip fail: %s", srcFile);
 		}
 		else {
-			Dbg("在zip文件中创建新目录失败: %s", new_file_name);
+			//Dbg("在zip文件中创建新目录失败: %s", new_file_name);
+			Dbg("XZipZilb create dir in zip fail: %s", new_file_name);
 		}
 		return false;
 	}
@@ -88,7 +96,8 @@ bool AddFileToZip(zipFile zf, const char* fileNameInZip, const char* srcFile)
 		srcfp = fopen(srcFile, "rb+");
 		if (srcfp == NULL)
 		{
-			Dbg("打开要往zip压缩的文件失败: %s", srcFile);
+			//Dbg("打开要往zip压缩的文件失败: %s", srcFile);
+			Dbg("XZipZilb open src file to zip is fail: %s", srcFile);
 			zipCloseFileInZip(zf); //关闭zip中的新文件
 			return false;
 		}
@@ -113,7 +122,8 @@ bool AddFileToZip(zipFile zf, const char* fileNameInZip, const char* srcFile)
 
 
 		if (sumWrite != fileLen) {
-			Dbg("文件写入zip压缩包失败,总长度不一致: %s", srcFile);
+			//Dbg("文件写入zip压缩包失败,总长度不一致: %s", srcFile);
+			Dbg("XZipZilb write to zip file is error ,sumWrite is not equal to fileLen, %s", srcFile);
 			fclose(srcfp);
 			zipCloseFileInZip(zf);
 			return false;//写文件失败