mod_UpgradeMgr.cpp 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490
  1. #include "stdafx.h"
  2. #include "mod_UpgradeMgr.h"
  3. #include "LocalMediaPlay_client_g.h"
  4. #include "fileutil.h"
  5. #include <regex>
  6. #include "RVCComm.h"
  7. #ifdef RVC_OS_WIN
  8. #include <io.h>
  9. #else
  10. #include <unistd.h>
  11. #include <dirent.h>
  12. #include <errno.h>
  13. #endif
  14. #include "EventCode.h"
  15. #include "json/json.h"
  16. namespace Task
  17. {
  18. //查询灰度控制
  19. struct QueryUpgradeControlTaskReq : CHTTPReq {
  20. string m_reqStr;
  21. string ToJson() {
  22. return m_reqStr;
  23. }
  24. };
  25. struct QueryUpgradeControlTaskRet : CHTTPRet {
  26. string m_retStr;
  27. bool Parse(string strData) {
  28. m_retStr=strData;
  29. return true;
  30. }
  31. };
  32. struct InitFSMTask : public ITaskSp{
  33. CUpgradeMgrEntity* Mgr;
  34. explicit InitFSMTask(CUpgradeMgrEntity* e) : Mgr(e) {}
  35. void Process(){
  36. LOG_FUNCTION();
  37. Mgr->bNewUpgradeMgr = true;//默认新模式
  38. LogWarn(Severity_Low, Error_Exception, WARN_TASK_START_NEW_MODE, "init new upgradeTaskMgr");
  39. if(Mgr->bNewUpgradeMgr){
  40. ErrorCodeEnum rc =Mgr->m_taskFSM.Init(Mgr);//启动新状态机
  41. if (rc != Error_Succeed)
  42. {
  43. LogWarn(Severity_Middle, Error_Exception, ERR_TASK_INIT_NEW_UPGRADE, "init new upgradeTaskMgr FSM fail");
  44. Mgr->m_testResult=Error_InvalidState;//自检失败
  45. return;
  46. }else{
  47. DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("InitFSMTask")("init new upgradeTaskMgr FSM succ");
  48. Mgr->m_initSucc = true;
  49. }
  50. Mgr->m_beginSM3HashTime = CSmallDateTime::GetNow();
  51. }else{
  52. LogWarn(Severity_Low, Error_Exception, WARN_TASK_START_OLD_MODE, "init old upgradeTaskMgr");
  53. }
  54. }
  55. };
  56. struct RollBackTask : public ITaskSp {
  57. CUpgradeMgrEntity* Mgr;
  58. CVersion historyVersion;
  59. explicit RollBackTask(CUpgradeMgrEntity* e, CVersion version) : Mgr(e) {
  60. historyVersion = version;
  61. }
  62. void Process() {
  63. bool loop = true;
  64. while (loop) {
  65. //判断是否继续执行
  66. CSmartPointer<IConfigInfo> spConfig;
  67. ErrorCodeEnum ret = Mgr->GetFunction()->OpenConfig(Config_CenterSetting, spConfig);
  68. int rollbackTemp = 0;
  69. if (ret == Error_Succeed) {
  70. spConfig->ReadConfigValueInt("UpgradeManager", "RollbackFlag", rollbackTemp);
  71. DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("RollbackUpdate")("get centerSetting RollbackFlag=%d", rollbackTemp);
  72. }
  73. else {
  74. DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("RollbackUpdate")("get centerSetting RollbackFlag fail");
  75. }
  76. if (rollbackTemp == 0) {
  77. //立即回退模式
  78. DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Immediate mode,begin rollback version");
  79. ErrorCodeEnum rc = Mgr->m_taskFSM.RollBackToHistoryVersion(historyVersion);
  80. if (rc == Error_Succeed)
  81. {
  82. // 通过事件通知健康实体
  83. LogEvent(Severity_Middle, Event_Req_Framework_Rollback, "rollback upgrade succeed");
  84. }
  85. else
  86. {
  87. LogError(Severity_Low, rc, 0, "rollback upgrade fail");
  88. }
  89. loop = false;//退出
  90. }
  91. else {
  92. //等待首页回退模式
  93. CSimpleStringA strValue;
  94. if (Mgr->GetFunction()->GetSysVar("UIState", strValue) == Error_Succeed && strValue.Compare("M") == 0) {
  95. // 已经进入首页,开始回退
  96. DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("enter main page, begin rollback version");
  97. ErrorCodeEnum rc = Mgr->m_taskFSM.RollBackToHistoryVersion(historyVersion);
  98. if (rc == Error_Succeed)
  99. {
  100. // 通过事件通知健康实体
  101. LogEvent(Severity_Middle, Event_Req_Framework_Rollback, "rollback upgrade succeed");
  102. }
  103. else
  104. {
  105. LogError(Severity_Low, rc, 0, "rollback upgrade fail");
  106. }
  107. loop = false;//退出
  108. }
  109. else {
  110. Sleep(30 * 1000);//继续循环
  111. DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("enter not main page, rollback version delay 30s");
  112. }
  113. }
  114. }
  115. Mgr->m_taskFSM.m_bRollbackTask = false;//线程退出
  116. }
  117. };
  118. }
  119. // 升级管理 UpgradeManager 0x506
  120. void CUpgradeMgrEntity::OnStarted()
  121. {
  122. // 初始化状态机
  123. //m_fsm.Init(this);
  124. auto pFunc = GetFunction();
  125. // 监视准入状态
  126. ErrorCodeEnum rc;
  127. CSimpleStringA strValue;
  128. if (pFunc->GetSysVar("UIState", strValue) == Error_Succeed && strValue.Compare("M") ==0)
  129. {
  130. // 已经进入首页状态
  131. DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("OnStarted")("system page isStartup 1");
  132. m_bStartUp =true;
  133. }
  134. else
  135. {
  136. // 否则启动监控
  137. rc= pFunc->RegistSysVarEvent("UIState", this);
  138. if (rc != Error_Succeed)
  139. {
  140. LogWarn(Severity_Middle, rc, ERR_WRAN_REGIST_SYS_VAR_FAIL, CSimpleStringA::Format("RegistSysVarEvent UIState is fail,%d",(int)rc).GetData());
  141. m_testResult=Error_InvalidState;//自检失败
  142. }else{
  143. DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("OnStarted")("RegistSysVarEvent UIState succ");
  144. }
  145. }
  146. if (pFunc->GetSysVar("RunState", strValue) == Error_Succeed && strValue.Compare("N") ==0)
  147. {
  148. // 已经进入终端启动成功状态
  149. DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("OnStarted")("====framework is start up 1====");
  150. m_bSystemStartUp =true;
  151. }
  152. else
  153. {
  154. // 否则启动监控RunState
  155. rc= pFunc->RegistSysVarEvent("RunState", this);
  156. if (rc != Error_Succeed)
  157. {
  158. LogWarn(Severity_Middle, rc, ERR_WRAN_REGIST_SYS_VAR_FAIL, CSimpleStringA::Format("RegistSysVarEvent RunState is fail,%d",(int)rc).GetData());
  159. m_testResult=Error_InvalidState;//自检失败
  160. }else{
  161. DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("OnStarted")("RegistSysVarEvent RunState succ");
  162. }
  163. }
  164. //启动灰度控制判断,看启动什么状态机
  165. Task::InitFSMTask* task = new Task::InitFSMTask(this);
  166. rc = this->GetFunction()->PostThreadPoolTask(task);
  167. if (rc != Error_Succeed)
  168. {
  169. LogError(Severity_Middle, rc, 0, CSimpleStringA::Format("Post InitFSMTask task to Thread is fail,%d",(int)rc).GetData());
  170. m_testResult=Error_InvalidState;//自检失败
  171. }
  172. }
  173. void CUpgradeMgrEntity::OnSelfTest(EntityTestEnum eTestType,CSmartPointer<ITransactionContext> pTransactionContext)
  174. {
  175. if (Test_ShakeHand == eTestType)
  176. {
  177. //根据不同情况返回握手情况,监控实体根据不同情况杀死实体进程
  178. pTransactionContext->SendAnswer(m_testResult);
  179. }
  180. }
  181. void CUpgradeMgrEntity::OnPreClose(EntityCloseCauseEnum eCloseCause,CSmartPointer<ITransactionContext> pTransactionContext)
  182. {
  183. GetFunction()->UnsubscribeBroadcast("Download");
  184. GetFunction()->UnsubscribeBroadcast("UpgradeRun");
  185. pTransactionContext->SendAnswer(Error_Succeed);
  186. }
  187. void CUpgradeMgrEntity::OnSysVarEvent(const char *pszKey, const char *pszValue,const char *pszOldValue,const char *pszEntityName)
  188. {
  189. if(strcmp("UIState",pszKey)==0){
  190. if(!m_bStartUp){
  191. if (strcmp(pszValue, "M") ==0){
  192. DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("OnSysVarEvent")("system page isStartup 2");
  193. m_bStartUp = true;
  194. }
  195. }
  196. }
  197. if(strcmp("RunState",pszKey)==0){
  198. if(!m_bSystemStartUp){
  199. if (strcmp(pszValue, "N") ==0){
  200. DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("OnSysVarEvent")("====framework is start up 2====");
  201. m_bSystemStartUp = true;
  202. }
  203. }
  204. }
  205. }
  206. char CUpgradeMgrEntity::GetInstallStateVal(const InstallStateEnum enumVal)
  207. {
  208. const struct {
  209. int ch;
  210. InstallStateEnum val;
  211. } tbl[] = {
  212. {'A', Install_Active},
  213. {'I', Install_Pending},
  214. {'S', Install_SetToStart},
  215. {'F', Install_FailRun},
  216. {'R', Install_RollBack},
  217. {'U', Install_Upgraded},
  218. {'C',Install_Cancelled},
  219. {'W',Install_WaitConfirm},
  220. {'D', Install_Installed},
  221. };
  222. int i;
  223. for (i = 0; i < sizeof(tbl)/sizeof(tbl[0]); ++i) {
  224. if (tbl[i].val == enumVal) {
  225. return tbl[i].ch;
  226. }
  227. }
  228. return ' '; // error
  229. }
  230. //新状态机不处理
  231. ErrorCodeEnum CUpgradeMgrEntity::RegistLocalPack(const CSimpleStringA &strPackFile)
  232. {
  233. if(m_initSucc){
  234. DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("RegistLocalPack")("RegistLocalPack new UpgradeMgr is not deal with");
  235. return Error_NotImpl;
  236. }else{
  237. DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("RegistLocalPack")("initFSM is not end");
  238. return Error_Pending;//状态机还未启动
  239. }
  240. }
  241. //新状态机不处理
  242. DWORD CUpgradeMgrEntity::RegistManualPack(const CSimpleStringA &strPackFile)
  243. {
  244. if(m_initSucc){
  245. DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("RegistManualPack")("RegistManualPack new UpgradeMgr is not deal with");
  246. return UPGRADE_MGR_NOT_IMPLEMENT;
  247. }else{
  248. DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("RegistManualPack")("initFSM is not end");
  249. return Error_Pending;//状态机还未启动
  250. }
  251. }
  252. //新状态机不处理
  253. ErrorCodeEnum CUpgradeMgrEntity::CancelUpdate(const CSimpleStringA &strPackFile)
  254. {
  255. if(m_initSucc){
  256. DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("CancelUpdate")("CancelUpdate new UpgradeMgr is not deal with");
  257. return Error_NotImpl;
  258. }else{
  259. DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("CancelUpdate")("initFSM is not end");
  260. return Error_Pending;//状态机还未启动
  261. }
  262. }
  263. //新状态机处理
  264. ErrorCodeEnum CUpgradeMgrEntity::RollbackUpdate(const CSimpleStringA &strVersion)
  265. {
  266. if(m_initSucc){
  267. if(bNewUpgradeMgr){
  268. DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("RollbackUpdate")("RollbackUpdate new UpgradeMgr deal with");
  269. if(strVersion.GetLength()==0){
  270. LogError(Severity_Low, Error_NotImpl, 0, "version is empty , rollback upgrade fail");
  271. return Error_NotImpl;
  272. }else{
  273. ErrorCodeEnum rc = Error_Succeed;
  274. DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("RollbackUpdate")("try rollback to version: [%s]", (const char*)strVersion);
  275. int w1, w2, w3, w4;
  276. int ret = sscanf(strVersion, "%d.%d.%d.%d", &w1, &w2, &w3, &w4);
  277. if (ret <4)
  278. {
  279. DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("RollbackUpdate")("version [%s] parse fail", (const char*)strVersion);
  280. rc= Error_Param;
  281. }
  282. else
  283. { //回退放入线程当中
  284. if (!m_taskFSM.m_bRollbackTask) {
  285. Task::RollBackTask* rTask = new Task::RollBackTask(this, CVersion(w1, w2, w3, w4));
  286. ErrorCodeEnum rc = this->GetFunction()->PostThreadPoolTask(rTask);
  287. if (Error_Succeed == rc) {
  288. DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("RollbackUpdate")("RollbackFlag thread start succ");
  289. m_taskFSM.m_bRollbackTask = true;//启动线程
  290. }
  291. else {
  292. DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("RollbackUpdate")("RollbackFlag thread start fail : %d",(int)rc);
  293. }
  294. }
  295. else {
  296. DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("RollbackUpdate")("RollbackFlag thread is exist");
  297. return Error_Succeed;
  298. }
  299. }
  300. }
  301. }else{
  302. DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("RollbackUpdate")("RollbackUpdate old UpgradeMgr deal not with");
  303. return Error_Succeed;
  304. }
  305. }else{
  306. DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("RollbackUpdate")("initFSM is not end");
  307. return Error_Pending;//状态机还未启动
  308. }
  309. }
  310. //新状态机不处理
  311. DWORD CUpgradeMgrEntity::GetManualPacks(CSimpleStringA &strManualPacks)
  312. {
  313. if(m_initSucc){
  314. DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("GetManualPacks")("GetManualPacks new UpgradeMgr is not deal with");
  315. return UPGRADE_MGR_NOT_IMPLEMENT;
  316. }else{
  317. DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("GetManualPacks")("initFSM is not end");
  318. return Error_Pending;//状态机还未启动
  319. }
  320. }
  321. CServerSessionBase* CUpgradeMgrEntity::OnNewSession(const char* /*pszRemoteEntityName*/, const char * /*pszParam*/)
  322. {
  323. return new CUpgradeMgrSession(this);
  324. }
  325. //新状态机不处理
  326. ErrorCodeEnum CUpgradeMgrEntity::SwitchUpgrade(const CSimpleStringA &strPack)
  327. {
  328. if(m_initSucc){
  329. DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("SwitchUpgrade")("SwitchUpgrade new UpgradeMgr is not deal with");
  330. return Error_NotImpl;
  331. }else{
  332. DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("SwitchUpgrade")("initFSM is not end");
  333. return Error_Pending;//状态机还未启动
  334. }
  335. }
  336. //新状态机处理
  337. ErrorCodeEnum CUpgradeMgrEntity::GetUpgradeState(bool &bInstalling, CSimpleStringA &strPackFile, CSimpleStringA &strExecID,
  338. char &cInstallState, bool &bSysInstall, bool &bLightPack, CSimpleStringA &strNewVersion)
  339. {
  340. if(m_initSucc){
  341. DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("GetUpgradeState")("GetUpgradeState new UpgradeMgr deal with");
  342. return m_taskFSM.GetUpgradeState(bInstalling, strPackFile, strExecID, cInstallState, bSysInstall, bLightPack, strNewVersion);
  343. }else{
  344. DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("GetUpgradeState")("initFSM is not end");
  345. return Error_Pending;//状态机还未启动
  346. }
  347. }
  348. ErrorCodeEnum CUpgradeMgrEntity::testActive()
  349. {
  350. CSimpleStringA rootVerPath;
  351. ErrorCodeEnum rc = this->GetFunction()->GetPath("RootVer",rootVerPath);//获取version根路径
  352. if(rc!=Error_Succeed){
  353. LogWarn(Severity_Middle, Error_Exception, ERR_WRAN_OPEN_ACTIVE_FAIL,"testActive fail , get RootVer path is fai");
  354. return Error_Bug;
  355. }
  356. CSimpleStringA strActiveFile = CSimpleStringA::Format("%s" SPLIT_SLASH_STR "active.txt", rootVerPath.GetData());
  357. FILE* fp = fopen(strActiveFile.GetData(),"rb+");
  358. if(fp==NULL){
  359. #ifdef RVC_OS_WIN
  360. LogWarn(Severity_Middle, Error_Exception, ERR_WRAN_OPEN_ACTIVE_FAIL,CSimpleStringA::Format("open write active.txt fail,please edit active attribute, err=%d",(int)GetLastError()).GetData());
  361. #else
  362. LogWarn(Severity_Middle, Error_Exception, ERR_WRAN_OPEN_ACTIVE_FAIL,CSimpleStringA::Format("open write active.txt fail,please edit active attribute, err=%d",errno).GetData());
  363. #endif
  364. return Error_Unexpect;
  365. }
  366. fclose(fp);
  367. return Error_Succeed;
  368. }
  369. ErrorCodeEnum CUpgradeMgrEntity::NewStopMediaPlay()
  370. {
  371. #ifdef RVC_OS_WIN
  372. // 通知媒体停止播放广告和声音
  373. LocalMediaPlay::PlayService_ClientBase *pClient = new LocalMediaPlay::PlayService_ClientBase(this);
  374. ErrorCodeEnum rc = pClient->Connect();
  375. if (rc == Error_Succeed)
  376. {
  377. DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("NewStopMediaPlay")("connect to entity [LocalMediaPlay] succeed, start StopMediaPlay now");
  378. //采用新接口停止所有音视频播放
  379. LocalMediaPlay::PlayService_StopPlayAllMedias_Req req1 = {};
  380. LocalMediaPlay::PlayService_StopPlayAllMedias_Ans ans1 = {};
  381. if (Error_Succeed == (*pClient)(EntityResource::getLink().upgradeLink())->StopPlayAllMedias(req1, ans1, 10000))
  382. {
  383. DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("NewStopMediaPlay")("StopPlayAllMedias success");
  384. }else{
  385. DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("NewStopMediaPlay")("StopPlayAllMedias fail");
  386. pClient->GetFunction()->CloseSession();
  387. pClient->SafeDelete();
  388. return rc;
  389. }
  390. pClient->GetFunction()->CloseSession();
  391. }
  392. else
  393. {
  394. LogError(Severity_Low, rc, 0, "connect to entity [LocalMediaPlay] fail");
  395. }
  396. pClient->SafeDelete();
  397. return rc;
  398. #else
  399. // 通知媒体停止播放广告和声音
  400. LocalMediaPlay::PlayService_ClientBase *pClient = new LocalMediaPlay::PlayService_ClientBase(this);
  401. ErrorCodeEnum rc = pClient->Connect();
  402. if (rc == Error_Succeed)
  403. {
  404. DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("NewStopMediaPlay")("connect to entity [LocalMediaPlay] succeed, start StopMediaPlay now");
  405. LocalMediaPlay::PlayService_StopPlayVideo_Req req1 = {};
  406. LocalMediaPlay::PlayService_StopPlayVideo_Ans ans1 = {};
  407. req1.CfgInx = 1;
  408. rc = (*pClient)(EntityResource::getLink().upgradeLink())->StopPlayVideo(req1, ans1, 10000);
  409. if (Error_Succeed == rc)
  410. {
  411. DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("NewStopMediaPlay")("StopPlayVideo success");
  412. }else{
  413. Dbg("StopPlayVideo fail");
  414. pClient->GetFunction()->CloseSession();
  415. pClient->SafeDelete();
  416. return rc;
  417. }
  418. LocalMediaPlay::PlayService_StopPlayAudio_Req req2 = {};
  419. LocalMediaPlay::PlayService_StopPlayAudio_Ans ans2 = {};
  420. rc = (*pClient)(EntityResource::getLink().upgradeLink())->StopPlayAudio(req2, ans2, 10000);
  421. if (Error_Succeed == rc)
  422. {
  423. Dbg("StopPlayAudio success");
  424. }else{
  425. Dbg("StopPlayAudio fail");
  426. pClient->GetFunction()->CloseSession();
  427. pClient->SafeDelete();
  428. return rc;
  429. }
  430. pClient->GetFunction()->CloseSession();
  431. }
  432. else
  433. {
  434. LogError(Severity_Low, rc, 0, "connect to entity [LocalMediaPlay] fail");
  435. pClient->SafeDelete();
  436. }
  437. return rc;
  438. #endif
  439. }
  440. SP_BEGIN_ENTITY_MAP()
  441. SP_ENTITY(CUpgradeMgrEntity)
  442. SP_END_ENTITY_MAP()
  443. void CUpgradeMgrEntity::HttpsLogCallBack(const char* logtxt)
  444. {
  445. if(logtxt!=NULL){
  446. DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI("HttpsLogCallBack")("http dbg: %s",logtxt);
  447. }
  448. }