Ver código fonte

#IQRV #comment [UpgradeMgr] 格式调整

gifur 3 anos atrás
pai
commit
8f7584ab68
1 arquivos alterados com 3 adições e 24 exclusões
  1. 3 24
      Module/mod_UpgradeMgr/UpgradeTaskFSM.cpp

+ 3 - 24
Module/mod_UpgradeMgr/UpgradeTaskFSM.cpp

@@ -21,7 +21,8 @@
 #include "XUnZipZilb.h"
 #endif
 
-
+#define SAFE_DELETE_HTTPCLIENT(obj)	\
+	do{if(obj != NULL) { obj->Destory(); obj = NULL; }}while(false)
 
 namespace Task
 {
@@ -98,7 +99,7 @@ namespace Task
 			if(!m_fsm->m_isSM3HashSucc){
 				return false;
 			}
-
+			
 			IHttpFunc* client;
 			client = create_http(m_fsm->HttpsLogCallBack);
 			//发送hash
@@ -406,27 +407,6 @@ namespace Task
 				isSendSucc = false;
 			}
 
-			//联调使用????
-			//isSendSucc = true;
-			//isTask_valid = true;
-
-			//m_fsm->m_currentTask.download_url = "https://127.0.0.1/api";
-			//m_fsm->m_currentTask.pack_hash = "123456789abcdefg";
-			//m_fsm->m_currentTask.pack_length = 1000;
-			//m_fsm->m_currentTask.pack_version = "";
-			//m_fsm->m_currentTask.reboot_type = "1";
-			//m_fsm->m_currentTask.stop_media_play = true;
-
-			//CUpgradeTaskFSM::CInstallStep* iStep= new CUpgradeTaskFSM::CInstallStep();
-			//iStep->stepSeq = 1;
-			//iStep->cmdType = "Run";
-			//iStep->cmdFail = "0";
-			//iStep->srcPathType = "";
-			//iStep->srcPath = "";
-			//iStep->dstPathType ="4";
-			//iStep->dstPath ="test.bat";
-			//m_fsm->m_currentTask.install_step.push(iStep);//加入队尾
-
 			client->Destory();
 			m_fsm->PostEventFIFO(new CUpgradeTaskFSM::QueryCurrTaskEvent(isSendSucc,isTask_valid));//返回处理结果
 		}
@@ -1344,7 +1324,6 @@ namespace Task
 			int time_out = DOWNLOAD_TIMEOUT;
 			
 			if(!client->DownloadFileBlock(downloadUrl.GetData(),jsonReq.c_str(),respContent,httpCode,responseHeaders,time_out)){
-				//Dbg("DownloadPackTask http req fail");
 				LogWarn(Severity_Middle, Error_Exception, ERR_TASK_DOWNLOAD_PACK_FAIL,CSimpleStringA::Format("DownloadPackTask http req fail,url=%s",downloadUrl.GetData()).GetData());
 				return false;//失败
 			}