mod_UpgradeMgr.cpp 16 KB

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