Skip to content

Commit 20c07b9

Browse files
committed
modify:info report support connect timeout
1 parent baaf87d commit 20c07b9

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

XEngine_Source/StorageModule_InfoReport/InfoReport_APIMachine/InfoReport_APIMachine.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ bool CInfoReport_APIMachine::InfoReport_APIMachine_Send(LPCXSTR lpszAPIUrl)
5353
XCHAR tszOSBuild[128] = {};
5454
XCHAR tszComputerName[128] = {};
5555
XLONG nOSArch = 0;
56+
57+
XCLIENT_APIHTTP st_HTTPParam = {};
5658
SYSTEMAPI_SERIAL_INFOMATION st_SDKSerial = {};
59+
5760
SystemApi_System_GetSystemVer(tszOSName, tszOSVersion, tszOSBuild, &nOSArch);
5861
SystemApi_System_GetSysName(NULL, tszComputerName);
5962
SystemApi_HardWare_GetSerial(&st_SDKSerial);
@@ -72,7 +75,8 @@ bool CInfoReport_APIMachine::InfoReport_APIMachine_Send(LPCXSTR lpszAPIUrl)
7275
st_JsonBuilder["emitUTF8"] = true;
7376

7477
XCHAR* ptszMsgBuffer = NULL;
75-
if (!APIClient_Http_Request(_X("POST"), lpszAPIUrl, Json::writeString(st_JsonBuilder, st_JsonRoot).c_str(), &nCode, &ptszMsgBuffer, &nLen))
78+
st_HTTPParam.nTimeConnect = 2;
79+
if (!APIClient_Http_Request(_X("POST"), lpszAPIUrl, Json::writeString(st_JsonBuilder, st_JsonRoot).c_str(), &nCode, &ptszMsgBuffer, &nLen, NULL, NULL, &st_HTTPParam))
7680
{
7781
InfoReport_IsErrorOccur = true;
7882
InfoReport_dwErrorCode = APIClient_GetLastError();
@@ -82,6 +86,9 @@ bool CInfoReport_APIMachine::InfoReport_APIMachine_Send(LPCXSTR lpszAPIUrl)
8286

8387
return true;
8488
}
89+
//////////////////////////////////////////////////////////////////////////
90+
// 保护函数
91+
//////////////////////////////////////////////////////////////////////////
8592
bool CInfoReport_APIMachine::InfoReport_APIMachine_GetText(XCHAR* ptszMSGBuffer)
8693
{
8794
InfoReport_IsErrorOccur = false;

0 commit comments

Comments
 (0)