Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sbkclient
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李定达
sbkclient
Commits
f5d0f587
Commit
f5d0f587
authored
Jul 13, 2021
by
wuyang.zou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix New Feature: 超级大单时,请求报文 80M, 减少报文日志的输出次数,提高效率;
parent
a955dec6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
ZH_Client/fmclient.cpp
+9
-6
No files found.
ZH_Client/fmclient.cpp
View file @
f5d0f587
...
...
@@ -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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment