Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f26047cf
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
f26047cf
编写于
9月 11, 2022
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: fix compile error
上级
440d14e3
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
14 addition
and
15 deletion
+14
-15
source/libs/transport/src/transCli.c
source/libs/transport/src/transCli.c
+14
-15
未找到文件。
source/libs/transport/src/transCli.c
浏览文件 @
f26047cf
...
@@ -1419,37 +1419,37 @@ void transUnrefCliHandle(void* handle) {
...
@@ -1419,37 +1419,37 @@ void transUnrefCliHandle(void* handle) {
cliDestroyConn
((
SCliConn
*
)
handle
,
true
);
cliDestroyConn
((
SCliConn
*
)
handle
,
true
);
}
}
}
}
static
FORCE_INLINE
SCliThrd
*
transGetWorkThrdFromHandle
(
int64_t
handle
,
bool
*
validH
andle
)
{
static
FORCE_INLINE
SCliThrd
*
transGetWorkThrdFromHandle
(
STrans
*
trans
,
int64_t
h
andle
)
{
SCliThrd
*
pThrd
=
NULL
;
SCliThrd
*
pThrd
=
NULL
;
SExHandle
*
exh
=
transAcquireExHandle
(
transGetRefMgt
(),
handle
);
SExHandle
*
exh
=
transAcquireExHandle
(
transGetRefMgt
(),
handle
);
if
(
exh
==
NULL
)
{
if
(
exh
==
NULL
)
{
return
NULL
;
return
NULL
;
}
}
*
validHandle
=
true
;
if
(
exh
->
pThrd
==
NULL
&&
trans
!=
NULL
)
{
int
idx
=
cliRBChoseIdx
(
trans
);
if
(
idx
<
0
)
return
NULL
;
exh
->
pThrd
=
((
SCliObj
*
)
trans
->
tcphandle
)
->
pThreadObj
[
idx
];
}
pThrd
=
exh
->
pThrd
;
pThrd
=
exh
->
pThrd
;
transReleaseExHandle
(
transGetRefMgt
(),
handle
);
transReleaseExHandle
(
transGetRefMgt
(),
handle
);
return
pThrd
;
return
pThrd
;
}
}
SCliThrd
*
transGetWorkThrd
(
STrans
*
trans
,
int64_t
handle
,
bool
*
validHandle
)
{
SCliThrd
*
transGetWorkThrd
(
STrans
*
trans
,
int64_t
handle
)
{
if
(
handle
==
0
)
{
if
(
handle
==
0
)
{
int
idx
=
cliRBChoseIdx
(
trans
);
int
idx
=
cliRBChoseIdx
(
trans
);
if
(
idx
<
0
)
return
NULL
;
if
(
idx
<
0
)
return
NULL
;
return
((
SCliObj
*
)
trans
->
tcphandle
)
->
pThreadObj
[
idx
];
return
((
SCliObj
*
)
trans
->
tcphandle
)
->
pThreadObj
[
idx
];
}
}
SCliThrd
*
pThrd
=
transGetWorkThrdFromHandle
(
handle
,
validHandle
);
SCliThrd
*
pThrd
=
transGetWorkThrdFromHandle
(
trans
,
handle
);
// if (pThrd == NULL) {
// int idx = cliRBChoseIdx(trans);
// if (idx < 0) return NULL;
// pThrd = ((SCliObj*)trans->tcphandle)->pThreadObj[idx];
// }
return
pThrd
;
return
pThrd
;
}
}
int
transReleaseCliHandle
(
void
*
handle
)
{
int
transReleaseCliHandle
(
void
*
handle
)
{
int
idx
=
-
1
;
int
idx
=
-
1
;
bool
valid
=
false
;
bool
valid
=
false
;
SCliThrd
*
pThrd
=
transGetWorkThrdFromHandle
(
(
int64_t
)
handle
,
&
valid
);
SCliThrd
*
pThrd
=
transGetWorkThrdFromHandle
(
NULL
,
(
int64_t
)
handle
);
if
(
pThrd
==
NULL
)
{
if
(
pThrd
==
NULL
)
{
return
-
1
;
return
-
1
;
}
}
...
@@ -1482,8 +1482,7 @@ int transSendRequest(void* shandle, const SEpSet* pEpSet, STransMsg* pReq, STran
...
@@ -1482,8 +1482,7 @@ int transSendRequest(void* shandle, const SEpSet* pEpSet, STransMsg* pReq, STran
return
-
1
;
return
-
1
;
}
}
bool
valid
=
false
;
SCliThrd
*
pThrd
=
transGetWorkThrd
(
pTransInst
,
(
int64_t
)
pReq
->
info
.
handle
);
SCliThrd
*
pThrd
=
transGetWorkThrd
(
pTransInst
,
(
int64_t
)
pReq
->
info
.
handle
,
&
valid
);
if
(
pThrd
==
NULL
)
{
if
(
pThrd
==
NULL
)
{
transFreeMsg
(
pReq
->
pCont
);
transFreeMsg
(
pReq
->
pCont
);
transReleaseExHandle
(
transGetInstMgt
(),
(
int64_t
)
shandle
);
transReleaseExHandle
(
transGetInstMgt
(),
(
int64_t
)
shandle
);
...
@@ -1527,9 +1526,8 @@ int transSendRecv(void* shandle, const SEpSet* pEpSet, STransMsg* pReq, STransMs
...
@@ -1527,9 +1526,8 @@ int transSendRecv(void* shandle, const SEpSet* pEpSet, STransMsg* pReq, STransMs
return
-
1
;
return
-
1
;
}
}
bool
valid
=
false
;
SCliThrd
*
pThrd
=
transGetWorkThrd
(
pTransInst
,
(
int64_t
)
pReq
->
info
.
handle
);
SCliThrd
*
pThrd
=
transGetWorkThrd
(
pTransInst
,
(
int64_t
)
pReq
->
info
.
handle
,
&
valid
);
if
(
pThrd
==
NULL
)
{
if
(
pThrd
==
NULL
&&
valid
==
false
)
{
transFreeMsg
(
pReq
->
pCont
);
transFreeMsg
(
pReq
->
pCont
);
transReleaseExHandle
(
transGetInstMgt
(),
(
int64_t
)
shandle
);
transReleaseExHandle
(
transGetInstMgt
(),
(
int64_t
)
shandle
);
return
TSDB_CODE_RPC_BROKEN_LINK
;
return
TSDB_CODE_RPC_BROKEN_LINK
;
...
@@ -1613,6 +1611,7 @@ int64_t transAllocHandle() {
...
@@ -1613,6 +1611,7 @@ int64_t transAllocHandle() {
SExHandle
*
exh
=
taosMemoryCalloc
(
1
,
sizeof
(
SExHandle
));
SExHandle
*
exh
=
taosMemoryCalloc
(
1
,
sizeof
(
SExHandle
));
exh
->
refId
=
transAddExHandle
(
transGetRefMgt
(),
exh
);
exh
->
refId
=
transAddExHandle
(
transGetRefMgt
(),
exh
);
tDebug
(
"pre alloc refId %"
PRId64
""
,
exh
->
refId
);
tDebug
(
"pre alloc refId %"
PRId64
""
,
exh
->
refId
);
return
exh
->
refId
;
return
exh
->
refId
;
}
}
#endif
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录