Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
4e6010f5
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
Star
22018
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看板
提交
4e6010f5
编写于
6月 09, 2022
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: avoid invalid conn
上级
e17b2e38
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
23 addition
and
12 deletion
+23
-12
source/dnode/mgmt/node_mgmt/src/dmTransport.c
source/dnode/mgmt/node_mgmt/src/dmTransport.c
+5
-5
source/libs/transport/src/transSvr.c
source/libs/transport/src/transSvr.c
+18
-7
未找到文件。
source/dnode/mgmt/node_mgmt/src/dmTransport.c
浏览文件 @
4e6010f5
...
...
@@ -23,7 +23,7 @@ static void dmBuildMnodeRedirectRsp(SDnode *pDnode, SRpcMsg *pMsg);
static
inline
int32_t
dmBuildNodeMsg
(
SRpcMsg
*
pMsg
,
SRpcMsg
*
pRpc
)
{
SRpcConnInfo
connInfo
=
{
0
};
if
(
IsReq
(
pRpc
)
&&
rpcGetConnInfo
(
pRpc
->
info
.
handle
,
&
connInfo
)
!=
0
)
{
if
(
IsReq
(
pRpc
)
&&
rpcGetConnInfo
(
&
pRpc
->
info
,
&
connInfo
)
!=
0
)
{
terrno
=
TSDB_CODE_MND_NO_USER_FROM_CONN
;
dError
(
"failed to build msg since %s, app:%p handle:%p"
,
terrstr
(),
pRpc
->
info
.
ahandle
,
pRpc
->
info
.
handle
);
return
-
1
;
...
...
@@ -49,9 +49,9 @@ int32_t dmProcessNodeMsg(SMgmtWrapper *pWrapper, SRpcMsg *pMsg) {
}
static
void
dmProcessRpcMsg
(
SDnode
*
pDnode
,
SRpcMsg
*
pRpc
,
SEpSet
*
pEpSet
)
{
SDnodeTrans
*
pTrans
=
&
pDnode
->
trans
;
SDnodeTrans
*
pTrans
=
&
pDnode
->
trans
;
int32_t
code
=
-
1
;
SRpcMsg
*
pMsg
=
NULL
;
SRpcMsg
*
pMsg
=
NULL
;
SMgmtWrapper
*
pWrapper
=
NULL
;
SDnodeHandle
*
pHandle
=
&
pTrans
->
msgHandles
[
TMSG_INDEX
(
pRpc
->
msgType
)];
...
...
@@ -167,11 +167,11 @@ int32_t dmInitMsgHandle(SDnode *pDnode) {
for
(
EDndNodeType
ntype
=
DNODE
;
ntype
<
NODE_END
;
++
ntype
)
{
SMgmtWrapper
*
pWrapper
=
&
pDnode
->
wrappers
[
ntype
];
SArray
*
pArray
=
(
*
pWrapper
->
func
.
getHandlesFp
)();
SArray
*
pArray
=
(
*
pWrapper
->
func
.
getHandlesFp
)();
if
(
pArray
==
NULL
)
return
-
1
;
for
(
int32_t
i
=
0
;
i
<
taosArrayGetSize
(
pArray
);
++
i
)
{
SMgmtHandle
*
pMgmt
=
taosArrayGet
(
pArray
,
i
);
SMgmtHandle
*
pMgmt
=
taosArrayGet
(
pArray
,
i
);
SDnodeHandle
*
pHandle
=
&
pTrans
->
msgHandles
[
TMSG_INDEX
(
pMgmt
->
msgType
)];
if
(
pMgmt
->
needCheckVgId
)
{
pHandle
->
needCheckVgId
=
pMgmt
->
needCheckVgId
;
...
...
source/libs/transport/src/transSvr.c
浏览文件 @
4e6010f5
...
...
@@ -1153,23 +1153,34 @@ _return2:
rpcFreeCont
(
msg
->
pCont
);
}
int
transGetConnInfo
(
void
*
thandle
,
STransHandleInfo
*
pInfo
)
{
int
transGetConnInfo
(
void
*
thandle
,
STransHandleInfo
*
p
Conn
Info
)
{
if
(
thandle
==
NULL
)
{
tTrace
(
"invalid handle %p, failed to Get Conn info"
,
thandle
);
return
-
1
;
}
SExHandle
*
ex
=
thandle
;
SSvrConn
*
pConn
=
ex
->
handle
;
SRpcHandleInfo
*
pInfo
=
thandle
;
SExHandle
*
exh
=
pInfo
->
handle
;
int64_t
refId
=
pInfo
->
refId
;
ASYNC_CHECK_HANDLE
(
exh
,
refId
);
// SExHandle* ex = thandle;
SSvrConn
*
pConn
=
exh
->
handle
;
if
(
pConn
==
NULL
)
{
tTrace
(
"invalid handle %p, failed to Get Conn info"
,
thandle
);
transReleaseExHandle
(
refMgt
,
refId
);
return
-
1
;
}
struct
sockaddr_in
addr
=
pConn
->
addr
;
pInfo
->
clientIp
=
(
uint32_t
)(
addr
.
sin_addr
.
s_addr
);
pInfo
->
clientPort
=
ntohs
(
addr
.
sin_port
);
tstrncpy
(
pInfo
->
user
,
pConn
->
user
,
sizeof
(
pInfo
->
user
));
pConnInfo
->
clientIp
=
(
uint32_t
)(
addr
.
sin_addr
.
s_addr
);
pConnInfo
->
clientPort
=
ntohs
(
addr
.
sin_port
);
tstrncpy
(
pConnInfo
->
user
,
pConn
->
user
,
sizeof
(
pConnInfo
->
user
));
transReleaseExHandle
(
refMgt
,
refId
);
return
0
;
_return1:
transReleaseExHandle
(
refMgt
,
refId
);
return
-
1
;
_return2:
return
-
1
;
}
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录