Commit f5d0f587 by wuyang.zou

Fix New Feature: 超级大单时,请求报文 80M, 减少报文日志的输出次数,提高效率;

parent a955dec6
......@@ -307,7 +307,8 @@ time_t subDay(time_t time1,int days)
// <4> 整合请求 UppSvr 的请求数据; [第一次调用本dll 会更新 秘钥: GetRSACret -> SendMsg(*,*,*)]
int ProcessPosReqData(const char *inReqData, int *needcheck, int *reqType_i, string &outPackData)
{
LOG() << "ProcessPosReqDataFun:: Begin-------->" << inReqData;
// 超级大单:200多个商品时, 请求报文 80M 左右,日志输出一次需要7s 左右; 为提高效率, 注释此处日志输出;
// LOG() << "ProcessPosReqDataFun:: Begin-------->" << inReqData;
int type, rlt = 0;
*reqType_i = -1;
std::stringstream tmps, tmpkey, datastm;
......@@ -469,7 +470,8 @@ int ProcessPosReqData(const char *inReqData, int *needcheck, int *reqType_i, str
outPackData = Tool::DocumentToString(tmproot);
LOG() << "ProcessPosReqDataFun:: Save Local Db Success, Then Request Upp Svr, ReqBody:" << outPackData;
// 超级大单:200多个商品时, 请求报文 80M 左右,日志输出一次需要7s 左右; 为提高效率, 注释此处日志输出;
LOG() << "ProcessPosReqDataFun:: Add PartnerOrderId Key And Save Local Db Success " ;
return 1;
}
......@@ -605,7 +607,7 @@ __declspec(dllexport) int __stdcall GetValue(char *indata, char *outdata)
LOG() << "return json to pos" << outdata;
return 0;
}
LOG() << "[**** 1 ****]---->Recv Pos Request:: json data:" << indata ;
LOG() << "[**** 1 ****]---->Recv Pos Request:: json data: " << indata;
// char buffer[MAX_BUF_LEN] = { 0 }; // Request Body Too Big: 56 Product, Each Have 31 Discount Items. Req Body Big 25600 Bytes;
// 申请 Heap 内存,这样就可以动态申请 非固定长度内存; 保证请求报文不被截断
......@@ -645,7 +647,8 @@ __declspec(dllexport) int __stdcall GetValue(char *indata, char *outdata)
LOG() <<"Error:: "<< "return error message to pos :" << outdata ;
return 0;
}
LOG() << "[**** 2 ****]---->ProcessPosReqData Finished: " << tmpOutPackData;
// 超级大单:200多个商品时, 请求报文 80M 左右,日志输出一次需要7s 左右; 为提高效率, 注释此处日志输出;
LOG() << "[**** 2 ****]---->ProcessPosReqData Finished......";
//验证证书
if(global_info.useRSA == 1 && (global_info.serverpublickey.empty() || global_info.localprivatekey.empty()))
......@@ -661,9 +664,9 @@ __declspec(dllexport) int __stdcall GetValue(char *indata, char *outdata)
global_info.sign.clear();
global_info.error = string(ERROR_NETWORK);
//添加 posType + dllVersion + ServerUrl + posIP;
//添加 posType + ServerUrl + dllVersion + posIP;
addRequestExtraFields(tmpOutPackData);
LOG() << "[**** 3 ****]---->addRequestExtraFields Finished Then Send Message To Upp Svr: " << tmpOutPackData;
LOG() << "[**** 3 ****]---->addRequestExtraFields (posType, serverUrl, dllVersion, posIp) Finished, Then Send Message To Upp Svr: " << tmpOutPackData;
if ( ( ssign = SendMsg(tmpOutPackData, global_info.serverurl, 0 ) ) != 1)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment