|
|
@@ -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;//失败
|
|
|
}
|