Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
b18cd2d4
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
b18cd2d4
编写于
10月 08, 2020
作者:
S
Shengliang Guan
提交者:
GitHub
10月 08, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #3760 from taosdata/patch/TD-1632
Patch/td 1632
上级
c87e3406
30474563
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
20 addition
and
24 deletion
+20
-24
src/rpc/src/rpcMain.c
src/rpc/src/rpcMain.c
+18
-22
src/rpc/src/rpcTcp.c
src/rpc/src/rpcTcp.c
+1
-1
src/rpc/src/rpcUdp.c
src/rpc/src/rpcUdp.c
+1
-1
未找到文件。
src/rpc/src/rpcMain.c
浏览文件 @
b18cd2d4
...
...
@@ -323,7 +323,7 @@ void *rpcMallocCont(int contLen) {
tError
(
"failed to malloc msg, size:%d"
,
size
);
return
NULL
;
}
else
{
t
Debug
(
"malloc msg
: %p"
,
start
);
t
Trace
(
"malloc mem
: %p"
,
start
);
}
return
start
+
sizeof
(
SRpcReqContext
)
+
sizeof
(
SRpcHead
);
...
...
@@ -333,7 +333,7 @@ void rpcFreeCont(void *cont) {
if
(
cont
)
{
char
*
temp
=
((
char
*
)
cont
)
-
sizeof
(
SRpcHead
)
-
sizeof
(
SRpcReqContext
);
free
(
temp
);
t
Debug
(
"free mem: %p"
,
temp
);
t
Trace
(
"free mem: %p"
,
temp
);
}
}
...
...
@@ -553,7 +553,7 @@ static void rpcFreeMsg(void *msg) {
if
(
msg
)
{
char
*
temp
=
(
char
*
)
msg
-
sizeof
(
SRpcReqContext
);
free
(
temp
);
t
Debug
(
"free msg
: %p"
,
temp
);
t
Trace
(
"free mem
: %p"
,
temp
);
}
}
...
...
@@ -819,9 +819,18 @@ static int rpcProcessReqHead(SRpcConn *pConn, SRpcHead *pHead) {
return
TSDB_CODE_RPC_LAST_SESSION_NOT_FINISHED
;
}
if
(
rpcContLenFromMsg
(
pHead
->
msgLen
)
<=
0
)
{
tDebug
(
"%s, message body is empty, ignore"
,
pConn
->
info
);
return
TSDB_CODE_RPC_APP_ERROR
;
}
pConn
->
inTranId
=
pHead
->
tranId
;
pConn
->
inType
=
pHead
->
msgType
;
// start the progress timer to monitor the response from server app
if
(
pConn
->
connType
!=
RPC_CONN_TCPS
)
pConn
->
pTimer
=
taosTmrStart
(
rpcProcessProgressTimer
,
tsProgressTimer
,
pConn
,
pConn
->
pRpc
->
tmrCtrl
);
return
0
;
}
...
...
@@ -960,11 +969,7 @@ static SRpcConn *rpcProcessMsgHead(SRpcInfo *pRpc, SRecvInfo *pRecv, SRpcReqCont
pConn
->
pIdleTimer
=
taosTmrStart
(
rpcProcessIdleTimer
,
tsRpcTimer
*
2
,
pConn
,
pRpc
->
tmrCtrl
);
}
else
{
terrno
=
rpcProcessRspHead
(
pConn
,
pHead
);
if
(
terrno
==
0
)
{
SRpcReqContext
*
pContext
=
pConn
->
pContext
;
*
ppContext
=
pContext
;
pConn
->
pContext
=
NULL
;
}
*
ppContext
=
pConn
->
pContext
;
}
}
...
...
@@ -1094,20 +1099,11 @@ static void rpcProcessIncomingMsg(SRpcConn *pConn, SRpcHead *pHead, SRpcReqConte
if
(
rpcIsReq
(
pHead
->
msgType
)
)
{
rpcMsg
.
ahandle
=
pConn
->
ahandle
;
if
(
rpcMsg
.
contLen
>
0
)
{
rpcMsg
.
handle
=
pConn
;
rpcAddRef
(
pRpc
);
// add the refCount for requests
rpcMsg
.
handle
=
pConn
;
rpcAddRef
(
pRpc
);
// add the refCount for requests
// start the progress timer to monitor the response from server app
if
(
pConn
->
connType
!=
RPC_CONN_TCPS
)
pConn
->
pTimer
=
taosTmrStart
(
rpcProcessProgressTimer
,
tsProgressTimer
,
pConn
,
pRpc
->
tmrCtrl
);
// notify the server app
(
*
(
pRpc
->
cfp
))(
&
rpcMsg
,
NULL
);
}
else
{
tDebug
(
"%s, message body is empty, ignore"
,
pConn
->
info
);
rpcFreeCont
(
rpcMsg
.
pCont
);
}
// notify the server app
(
*
(
pRpc
->
cfp
))(
&
rpcMsg
,
NULL
);
}
else
{
// it's a response
rpcMsg
.
handle
=
pContext
;
...
...
@@ -1451,7 +1447,7 @@ static SRpcHead *rpcDecompressRpcMsg(SRpcHead *pHead) {
pNewHead
->
msgLen
=
rpcMsgLenFromCont
(
origLen
);
rpcFreeMsg
(
pHead
);
// free the compressed message buffer
pHead
=
pNewHead
;
//tTrace("decompress rpc msg, compLen:%d, after:%d", compLen, contLen
);
tTrace
(
"decomp malloc mem: %p"
,
temp
);
}
else
{
tError
(
"failed to allocate memory to decompress msg, contLen:%d"
,
contLen
);
}
...
...
src/rpc/src/rpcTcp.c
浏览文件 @
b18cd2d4
...
...
@@ -438,7 +438,7 @@ static int taosReadTcpData(SFdObj *pFdObj, SRecvInfo *pInfo) {
tError
(
"%s %p TCP malloc(size:%d) fail"
,
pThreadObj
->
label
,
pFdObj
->
thandle
,
msgLen
);
return
-
1
;
}
else
{
t
Debug
(
"TCP malloc mem: %p"
,
buffer
);
t
Trace
(
"TCP malloc mem: %p"
,
buffer
);
}
msg
=
buffer
+
tsRpcOverhead
;
...
...
src/rpc/src/rpcUdp.c
浏览文件 @
b18cd2d4
...
...
@@ -214,7 +214,7 @@ static void *taosRecvUdpData(void *param) {
tError
(
"%s failed to allocate memory, size:%"
PRId64
,
pConn
->
label
,
(
int64_t
)
dataLen
);
continue
;
}
else
{
t
Debug
(
"UDP malloc mem: %p"
,
tmsg
);
t
Trace
(
"UDP malloc mem: %p"
,
tmsg
);
}
tmsg
+=
tsRpcOverhead
;
// overhead for SRpcReqContext
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录