Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
d3212463
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
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看板
提交
d3212463
编写于
3月 21, 2022
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
handle except
上级
bc77e3c5
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
54 addition
and
20 deletion
+54
-20
include/libs/transport/trpc.h
include/libs/transport/trpc.h
+11
-3
source/libs/index/src/index_fst_automation.c
source/libs/index/src/index_fst_automation.c
+1
-9
source/libs/transport/inc/transComm.h
source/libs/transport/inc/transComm.h
+1
-0
source/libs/transport/src/transCli.c
source/libs/transport/src/transCli.c
+6
-0
source/libs/transport/src/transComm.c
source/libs/transport/src/transComm.c
+10
-0
source/libs/transport/test/transUT.cc
source/libs/transport/test/transUT.cc
+25
-8
未找到文件。
include/libs/transport/trpc.h
浏览文件 @
d3212463
...
...
@@ -52,8 +52,8 @@ typedef struct {
char
user
[
TSDB_USER_LEN
];
SRpcMsg
rpcMsg
;
int32_t
rspLen
;
void
*
pRsp
;
void
*
pNode
;
void
*
pRsp
;
void
*
pNode
;
}
SNodeMsg
;
typedef
struct
SRpcInit
{
...
...
@@ -87,7 +87,15 @@ typedef struct {
}
SRpcCtxVal
;
typedef
struct
{
SHashObj
*
args
;
int32_t
msgType
;
void
*
val
;
int32_t
len
;
void
(
*
free
)(
void
*
arg
);
}
SRpcBrokenlinkVal
;
typedef
struct
{
SHashObj
*
args
;
SRpcBrokenlinkVal
brokenVal
;
}
SRpcCtx
;
int32_t
rpcInit
();
...
...
source/libs/index/src/index_fst_automation.c
浏览文件 @
d3212463
...
...
@@ -154,15 +154,7 @@ AutomationCtx* automCtxCreate(void* data, AutomationType atype) {
// add more search type
}
char
*
dst
=
NULL
;
if
(
data
!=
NULL
)
{
char
*
src
=
(
char
*
)
data
;
size_t
len
=
strlen
(
src
);
dst
=
(
char
*
)
calloc
(
1
,
len
*
sizeof
(
char
)
+
1
);
memcpy
(
dst
,
src
,
len
);
}
ctx
->
data
=
dst
;
ctx
->
data
=
strdup
((
char
*
)
data
);
ctx
->
type
=
atype
;
ctx
->
stdata
=
(
void
*
)
sv
;
return
ctx
;
...
...
source/libs/transport/inc/transComm.h
浏览文件 @
d3212463
...
...
@@ -277,6 +277,7 @@ void transCtxCleanup(STransCtx* ctx);
void
transCtxClear
(
STransCtx
*
ctx
);
void
transCtxMerge
(
STransCtx
*
dst
,
STransCtx
*
src
);
void
*
transCtxDumpVal
(
STransCtx
*
ctx
,
int32_t
key
);
void
*
transCtxDumpBrokenlinkVal
(
STransCtx
*
ctx
,
int32_t
*
msgType
);
// queue sending msgs
typedef
struct
{
...
...
source/libs/transport/src/transCli.c
浏览文件 @
d3212463
...
...
@@ -210,6 +210,9 @@ void cliHandleResp(SCliConn* conn) {
STransConnCtx
*
pCtx
=
pMsg
?
pMsg
->
ctx
:
NULL
;
if
(
pMsg
==
NULL
&&
!
CONN_NO_PERSIST_BY_APP
(
conn
))
{
transMsg
.
ahandle
=
transCtxDumpVal
(
&
conn
->
ctx
,
transMsg
.
msgType
);
if
(
transMsg
.
ahandle
==
NULL
)
{
transMsg
.
ahandle
=
transCtxDumpBrokenlinkVal
(
&
conn
->
ctx
,
(
int32_t
*
)
&
(
transMsg
.
msgType
));
}
}
else
{
transMsg
.
ahandle
=
pCtx
?
pCtx
->
ahandle
:
NULL
;
}
...
...
@@ -282,6 +285,9 @@ void cliHandleExcept(SCliConn* pConn) {
if
(
pMsg
==
NULL
&&
!
CONN_NO_PERSIST_BY_APP
(
pConn
))
{
transMsg
.
ahandle
=
transCtxDumpVal
(
&
pConn
->
ctx
,
transMsg
.
msgType
);
if
(
transMsg
.
ahandle
==
NULL
)
{
transMsg
.
ahandle
=
transCtxDumpBrokenlinkVal
(
&
pConn
->
ctx
,
(
int32_t
*
)
&
(
transMsg
.
msgType
));
}
}
else
{
transMsg
.
ahandle
=
pCtx
?
pCtx
->
ahandle
:
NULL
;
}
...
...
source/libs/transport/src/transComm.c
浏览文件 @
d3212463
...
...
@@ -238,12 +238,14 @@ void transCtxCleanup(STransCtx* ctx) {
iter
->
free
(
iter
->
val
);
iter
=
taosHashIterate
(
ctx
->
args
,
iter
);
}
taosHashCleanup
(
ctx
->
args
);
}
void
transCtxMerge
(
STransCtx
*
dst
,
STransCtx
*
src
)
{
if
(
dst
->
args
==
NULL
)
{
dst
->
args
=
src
->
args
;
dst
->
brokenVal
=
src
->
brokenVal
;
src
->
args
=
NULL
;
return
;
}
...
...
@@ -275,6 +277,14 @@ void* transCtxDumpVal(STransCtx* ctx, int32_t key) {
memcpy
(
ret
,
(
char
*
)
cVal
->
val
,
cVal
->
len
);
return
(
void
*
)
ret
;
}
void
*
transCtxDumpBrokenlinkVal
(
STransCtx
*
ctx
,
int32_t
*
msgType
)
{
char
*
ret
=
calloc
(
1
,
ctx
->
brokenVal
.
len
);
memcpy
(
ret
,
(
char
*
)(
ctx
->
brokenVal
.
val
),
ctx
->
brokenVal
.
len
);
*
msgType
=
ctx
->
brokenVal
.
msgType
;
return
(
void
*
)
ret
;
}
void
transQueueInit
(
STransQueue
*
queue
,
void
(
*
free
)(
void
*
arg
))
{
queue
->
q
=
taosArrayInit
(
2
,
sizeof
(
void
*
));
...
...
source/libs/transport/test/transUT.cc
浏览文件 @
d3212463
...
...
@@ -364,9 +364,12 @@ TEST_F(TransEnv, srvReleaseHandle) {
SRpcMsg
resp
=
{
0
};
tr
->
SetSrvContinueSend
(
processReleaseHandleCb
);
// tr->Restart(processReleaseHandleCb);
void
*
handle
=
NULL
;
void
*
handle
=
NULL
;
SRpcMsg
req
=
{
0
};
for
(
int
i
=
0
;
i
<
1
;
i
++
)
{
SRpcMsg
req
=
{.
handle
=
resp
.
handle
,
.
persistHandle
=
1
};
memset
(
&
req
,
0
,
sizeof
(
req
));
req
.
handle
=
resp
.
handle
;
req
.
persistHandle
=
1
;
req
.
msgType
=
1
;
req
.
pCont
=
rpcMallocCont
(
10
);
req
.
contLen
=
10
;
...
...
@@ -378,8 +381,11 @@ TEST_F(TransEnv, srvReleaseHandle) {
}
TEST_F
(
TransEnv
,
cliReleaseHandleExcept
)
{
SRpcMsg
resp
=
{
0
};
SRpcMsg
req
=
{
0
};
for
(
int
i
=
0
;
i
<
3
;
i
++
)
{
SRpcMsg
req
=
{.
handle
=
resp
.
handle
,
.
persistHandle
=
1
};
memset
(
&
req
,
0
,
sizeof
(
req
));
req
.
handle
=
resp
.
handle
;
req
.
persistHandle
=
1
;
req
.
msgType
=
1
;
req
.
pCont
=
rpcMallocCont
(
10
);
req
.
contLen
=
10
;
...
...
@@ -396,8 +402,10 @@ TEST_F(TransEnv, cliReleaseHandleExcept) {
}
TEST_F
(
TransEnv
,
srvContinueSend
)
{
tr
->
SetSrvContinueSend
(
processContinueSend
);
SRpcMsg
req
=
{
0
},
resp
=
{
0
};
for
(
int
i
=
0
;
i
<
10
;
i
++
)
{
SRpcMsg
req
=
{
0
},
resp
=
{
0
};
memset
(
&
req
,
0
,
sizeof
(
req
));
memset
(
&
resp
,
0
,
sizeof
(
resp
));
req
.
msgType
=
1
;
req
.
pCont
=
rpcMallocCont
(
10
);
req
.
contLen
=
10
;
...
...
@@ -410,8 +418,10 @@ TEST_F(TransEnv, srvPersistHandleExcept) {
tr
->
SetSrvContinueSend
(
processContinueSend
);
// tr->SetCliPersistFp(cliPersistHandle);
SRpcMsg
resp
=
{
0
};
SRpcMsg
req
=
{
0
};
for
(
int
i
=
0
;
i
<
5
;
i
++
)
{
SRpcMsg
req
=
{.
handle
=
resp
.
handle
};
memset
(
&
req
,
0
,
sizeof
(
req
));
req
.
handle
=
resp
.
handle
;
req
.
msgType
=
1
;
req
.
pCont
=
rpcMallocCont
(
10
);
req
.
contLen
=
10
;
...
...
@@ -428,8 +438,10 @@ TEST_F(TransEnv, srvPersistHandleExcept) {
TEST_F
(
TransEnv
,
cliPersistHandleExcept
)
{
tr
->
SetSrvContinueSend
(
processContinueSend
);
SRpcMsg
resp
=
{
0
};
SRpcMsg
req
=
{
0
};
for
(
int
i
=
0
;
i
<
5
;
i
++
)
{
SRpcMsg
req
=
{.
handle
=
resp
.
handle
};
memset
(
&
req
,
0
,
sizeof
(
req
));
req
.
handle
=
resp
.
handle
;
req
.
msgType
=
1
;
req
.
pCont
=
rpcMallocCont
(
10
);
req
.
contLen
=
10
;
...
...
@@ -450,8 +462,11 @@ TEST_F(TransEnv, multiCliPersistHandleExcept) {
TEST_F
(
TransEnv
,
queryExcept
)
{
tr
->
SetSrvContinueSend
(
processRegisterFailure
);
SRpcMsg
resp
=
{
0
};
SRpcMsg
req
=
{
0
};
for
(
int
i
=
0
;
i
<
5
;
i
++
)
{
SRpcMsg
req
=
{.
handle
=
resp
.
handle
,
.
persistHandle
=
1
};
memset
(
&
req
,
0
,
sizeof
(
req
));
req
.
handle
=
resp
.
handle
;
req
.
persistHandle
=
1
;
req
.
msgType
=
1
;
req
.
pCont
=
rpcMallocCont
(
10
);
req
.
contLen
=
10
;
...
...
@@ -466,8 +481,10 @@ TEST_F(TransEnv, queryExcept) {
}
TEST_F
(
TransEnv
,
noResp
)
{
SRpcMsg
resp
=
{
0
};
SRpcMsg
req
=
{
0
};
for
(
int
i
=
0
;
i
<
5
;
i
++
)
{
SRpcMsg
req
=
{.
noResp
=
1
};
memset
(
&
req
,
0
,
sizeof
(
req
));
req
.
noResp
=
1
;
req
.
msgType
=
1
;
req
.
pCont
=
rpcMallocCont
(
10
);
req
.
contLen
=
10
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录