|
@@ -11,6 +11,8 @@
|
|
|
#include <stdlib.h>
|
|
|
#include "comm.h"
|
|
|
|
|
|
+#include "CommEntityUtil.hpp"
|
|
|
+
|
|
|
#ifdef WITH_CPPRESTSDK
|
|
|
#include "CommEntityRestful.hpp"
|
|
|
#else
|
|
@@ -144,6 +146,26 @@ struct StageReportTask :public ITaskSp {
|
|
|
return;
|
|
|
}
|
|
|
} else {
|
|
|
+ std::string errDetail(result.WhatError());
|
|
|
+ if (errDetail.find("Error resolving address") != std::string::npos) {
|
|
|
+ std::string tmpDetail = SP::Module::Net::GetWWWInfoThroughDig(config.GetBaseUri());
|
|
|
+ if (!tmpDetail.empty()) {
|
|
|
+ SP::Utility::replaceInPlace(tmpDetail, "\n", "$$");
|
|
|
+ const int len = tmpDetail.length();
|
|
|
+ int pos = 0, times = 0;
|
|
|
+ const int each_size = 450;
|
|
|
+ std::vector<std::string> contents;
|
|
|
+ while (pos < len) {
|
|
|
+ const std::string elem = tmpDetail.substr(pos, (len - pos) > each_size ? each_size : std::string::npos);
|
|
|
+ pos = (++times) * each_size;
|
|
|
+ contents.push_back(elem);
|
|
|
+ LogWarn(Severity_Middle, Error_Debug, ERROR_ACCESSAUTH_ACS_DIGINFO,
|
|
|
+ CSimpleStringA::Format("[%d]%s", times, elem.c_str()));
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ LogWarn(Severity_Middle, Error_Debug, ERROR_ACCESSAUTH_ACS_DIGINFO, errDetail.c_str());
|
|
|
+ }
|
|
|
+ }
|
|
|
Dbg("StageReport Connect Failed(%d).", result.statusCode);
|
|
|
m_fsm->doWarnMsg(ERROR_ACCESSAUTH_CONNECT_ACS, GetOutPutStr("%s%s", "连接总行ACS准入服务失败(StageReport)."
|
|
|
, result.WhatError().c_str()).c_str());
|
|
@@ -220,7 +242,7 @@ struct TimeSynTask : ITaskSp {
|
|
|
config.PreDo();
|
|
|
client.Do(&config, &result);
|
|
|
|
|
|
- if (result.ResponseOK()) {
|
|
|
+ if (false && result.ResponseOK()) {
|
|
|
SP::Module::Restful::CommResponseJson responseStatus ;
|
|
|
SP::Module::Restful::GetStatusFromDebranchResponse(result.content, responseStatus);
|
|
|
|
|
@@ -256,6 +278,26 @@ struct TimeSynTask : ITaskSp {
|
|
|
Dbg("TimeSynTask HandleTimeSyn error = %08X", rc);
|
|
|
}
|
|
|
} else {
|
|
|
+ std::string errDetail(result.WhatError());
|
|
|
+ if (errDetail.find("Error resolving address") != std::string::npos) {
|
|
|
+ std::string tmpDetail = SP::Module::Net::GetWWWInfoThroughDig(config.GetBaseUri());
|
|
|
+ if (!tmpDetail.empty()) {
|
|
|
+ SP::Utility::replaceInPlace(tmpDetail, "\n", "$$");
|
|
|
+ const int len = tmpDetail.length();
|
|
|
+ int pos = 0, times = 0;
|
|
|
+ const int each_size = 450;
|
|
|
+ std::vector<std::string> contents;
|
|
|
+ while (pos < len) {
|
|
|
+ const std::string elem = tmpDetail.substr(pos, (len - pos) > each_size ? each_size : std::string::npos);
|
|
|
+ pos = (++times) * each_size;
|
|
|
+ contents.push_back(elem);
|
|
|
+ LogWarn(Severity_Middle, Error_Debug, ERROR_ACCESSAUTH_ACS_DIGINFO,
|
|
|
+ CSimpleStringA::Format("[%d]%s", times, elem.c_str()));
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ LogWarn(Severity_Middle, Error_Debug, ERROR_ACCESSAUTH_ACS_DIGINFO, errDetail.c_str());
|
|
|
+ }
|
|
|
+ }
|
|
|
m_fsm->doWarnMsg(ERROR_ACCESSAUTH_CONNECT_ACS,
|
|
|
GetOutPutStr("%s%s", "连接总行ACS准入服务失败(TimeSynTask).", result.WhatError().c_str()).c_str(), true);
|
|
|
Dbg("TimeSynTask Connect Failed.");
|
|
@@ -360,6 +402,26 @@ struct LockStateTask : ITaskSp {
|
|
|
Dbg("lockStateTask HandleLockState error = %08X", rc);
|
|
|
}
|
|
|
} else {
|
|
|
+ std::string errDetail(result.WhatError());
|
|
|
+ if (errDetail.find("Error resolving address") != std::string::npos) {
|
|
|
+ std::string tmpDetail = SP::Module::Net::GetWWWInfoThroughDig(config.GetBaseUri());
|
|
|
+ if (!tmpDetail.empty()) {
|
|
|
+ SP::Utility::replaceInPlace(tmpDetail, "\n", "$$");
|
|
|
+ const int len = tmpDetail.length();
|
|
|
+ int pos = 0, times = 0;
|
|
|
+ const int each_size = 450;
|
|
|
+ std::vector<std::string> contents;
|
|
|
+ while (pos < len) {
|
|
|
+ const std::string elem = tmpDetail.substr(pos, (len - pos) > each_size ? each_size : std::string::npos);
|
|
|
+ pos = (++times) * each_size;
|
|
|
+ contents.push_back(elem);
|
|
|
+ LogWarn(Severity_Middle, Error_Debug, ERROR_ACCESSAUTH_ACS_DIGINFO,
|
|
|
+ CSimpleStringA::Format("[%d]%s", times, elem.c_str()));
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ LogWarn(Severity_Middle, Error_Debug, ERROR_ACCESSAUTH_ACS_DIGINFO, errDetail.c_str());
|
|
|
+ }
|
|
|
+ }
|
|
|
m_fsm->doWarnMsg(ERROR_ACCESSAUTH_CONNECT_ACS,
|
|
|
GetOutPutStr("%s%s", "连接总行ACS准入服务失败(lockStateTask).", result.WhatError().c_str()).c_str(), true);
|
|
|
Dbg("lockStateTask Connect Failed.");
|
|
@@ -489,6 +551,26 @@ struct UpdateWKTask : ITaskSp {
|
|
|
Dbg("UpdateWKTask LoadKeysToPinPadNew error = %08X", rc);
|
|
|
}
|
|
|
} else {
|
|
|
+ std::string errDetail(result.WhatError());
|
|
|
+ if (errDetail.find("Error resolving address") != std::string::npos) {
|
|
|
+ std::string tmpDetail = SP::Module::Net::GetWWWInfoThroughDig(config.GetBaseUri());
|
|
|
+ if (!tmpDetail.empty()) {
|
|
|
+ SP::Utility::replaceInPlace(tmpDetail, "\n", "$$");
|
|
|
+ const int len = tmpDetail.length();
|
|
|
+ int pos = 0, times = 0;
|
|
|
+ const int each_size = 450;
|
|
|
+ std::vector<std::string> contents;
|
|
|
+ while (pos < len) {
|
|
|
+ const std::string elem = tmpDetail.substr(pos, (len - pos) > each_size ? each_size : std::string::npos);
|
|
|
+ pos = (++times) * each_size;
|
|
|
+ contents.push_back(elem);
|
|
|
+ LogWarn(Severity_Middle, Error_Debug, ERROR_ACCESSAUTH_ACS_DIGINFO,
|
|
|
+ CSimpleStringA::Format("[%d]%s", times, elem.c_str()));
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ LogWarn(Severity_Middle, Error_Debug, ERROR_ACCESSAUTH_ACS_DIGINFO, errDetail.c_str());
|
|
|
+ }
|
|
|
+ }
|
|
|
m_fsm->doWarnMsg(ERROR_ACCESSAUTH_CONNECT_ACS,
|
|
|
GetOutPutStr("%s%s", "连接总行ACS准入服务失败(UpdateWKTask).", result.WhatError().c_str()).c_str(), true);
|
|
|
Dbg("UpdateWKTask Connect Failed.");
|
|
@@ -549,6 +631,26 @@ struct UpdateWKTask : ITaskSp {
|
|
|
Dbg("UpdateWKTask LoadKeysToPinPadNew error = %08X", rc);
|
|
|
}
|
|
|
} else {
|
|
|
+ std::string errDetail(result.WhatError());
|
|
|
+ if (errDetail.find("Error resolving address") != std::string::npos) {
|
|
|
+ std::string tmpDetail = SP::Module::Net::GetWWWInfoThroughDig(config.GetBaseUri());
|
|
|
+ if (!tmpDetail.empty()) {
|
|
|
+ SP::Utility::replaceInPlace(tmpDetail, "\n", "$$");
|
|
|
+ const int len = tmpDetail.length();
|
|
|
+ int pos = 0, times = 0;
|
|
|
+ const int each_size = 450;
|
|
|
+ std::vector<std::string> contents;
|
|
|
+ while (pos < len) {
|
|
|
+ const std::string elem = tmpDetail.substr(pos, (len - pos) > each_size ? each_size : std::string::npos);
|
|
|
+ pos = (++times) * each_size;
|
|
|
+ contents.push_back(elem);
|
|
|
+ LogWarn(Severity_Middle, Error_Debug, ERROR_ACCESSAUTH_ACS_DIGINFO,
|
|
|
+ CSimpleStringA::Format("[%d]%s", times, elem.c_str()));
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ LogWarn(Severity_Middle, Error_Debug, ERROR_ACCESSAUTH_ACS_DIGINFO, errDetail.c_str());
|
|
|
+ }
|
|
|
+ }
|
|
|
m_fsm->doWarnMsg(ERROR_ACCESSAUTH_CONNECT_ACS,
|
|
|
GetOutPutStr("%s%d", "连接总行ACS准入服务失败(StageReport).", updateWKRet.m_sysCode).c_str());
|
|
|
Dbg("UpdateWKTask Connect Failed.");
|
|
@@ -731,6 +833,26 @@ struct GetTokenTask : ITaskSp {
|
|
|
Dbg("GetTokenTask HandleGetToken error = %08X", rc);
|
|
|
}
|
|
|
} else {
|
|
|
+ std::string errDetail(result.WhatError());
|
|
|
+ if (errDetail.find("Error resolving address") != std::string::npos) {
|
|
|
+ std::string tmpDetail = SP::Module::Net::GetWWWInfoThroughDig(config.GetBaseUri());
|
|
|
+ if (!tmpDetail.empty()) {
|
|
|
+ SP::Utility::replaceInPlace(tmpDetail, "\n", "$$");
|
|
|
+ const int len = tmpDetail.length();
|
|
|
+ int pos = 0, times = 0;
|
|
|
+ const int each_size = 450;
|
|
|
+ std::vector<std::string> contents;
|
|
|
+ while (pos < len) {
|
|
|
+ const std::string elem = tmpDetail.substr(pos, (len - pos) > each_size ? each_size : std::string::npos);
|
|
|
+ pos = (++times) * each_size;
|
|
|
+ contents.push_back(elem);
|
|
|
+ LogWarn(Severity_Middle, Error_Debug, ERROR_ACCESSAUTH_ACS_DIGINFO,
|
|
|
+ CSimpleStringA::Format("[%d]%s", times, elem.c_str()));
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ LogWarn(Severity_Middle, Error_Debug, ERROR_ACCESSAUTH_ACS_DIGINFO, errDetail.c_str());
|
|
|
+ }
|
|
|
+ }
|
|
|
m_fsm->doWarnMsg(ERROR_ACCESSAUTH_CONNECT_ACS,
|
|
|
GetOutPutStr("%s%s", "连接总行ACS准入服务失败(GetTokenTask).", result.WhatError().c_str()).c_str(), true);
|
|
|
Dbg("lockStateTask Connect Failed.");
|
|
@@ -888,6 +1010,26 @@ struct InitDeviceTask :public ITaskSp {
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
+ std::string errDetail(result.WhatError());
|
|
|
+ if (errDetail.find("Error resolving address") != std::string::npos) {
|
|
|
+ std::string tmpDetail = SP::Module::Net::GetWWWInfoThroughDig(config.GetBaseUri());
|
|
|
+ if (!tmpDetail.empty()) {
|
|
|
+ SP::Utility::replaceInPlace(tmpDetail, "\n", "$$");
|
|
|
+ const int len = tmpDetail.length();
|
|
|
+ int pos = 0, times = 0;
|
|
|
+ const int each_size = 450;
|
|
|
+ std::vector<std::string> contents;
|
|
|
+ while (pos < len) {
|
|
|
+ const std::string elem = tmpDetail.substr(pos, (len - pos) > each_size ? each_size : std::string::npos);
|
|
|
+ pos = (++times) * each_size;
|
|
|
+ contents.push_back(elem);
|
|
|
+ LogWarn(Severity_Middle, Error_Debug, ERROR_ACCESSAUTH_ACS_DIGINFO,
|
|
|
+ CSimpleStringA::Format("[%d]%s", times, elem.c_str()));
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ LogWarn(Severity_Middle, Error_Debug, ERROR_ACCESSAUTH_ACS_DIGINFO, errDetail.c_str());
|
|
|
+ }
|
|
|
+ }
|
|
|
m_fsm->doWarnMsg(ERROR_ACCESSAUTH_CONNECT_ACS,
|
|
|
GetOutPutStr("%s%d", "连接总行ACS准入服务失败(InitDeviceTask).", initDeviceRet.m_sysCode).c_str());
|
|
|
Dbg("InitDeviceTask Connect Failed.");
|