Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
b059cc4e
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看板
提交
b059cc4e
编写于
4月 25, 2023
作者:
K
kailixu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: code optimization
上级
78183406
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
21 addition
and
13 deletion
+21
-13
source/client/inc/clientInt.h
source/client/inc/clientInt.h
+1
-1
source/client/src/clientEnv.c
source/client/src/clientEnv.c
+1
-1
source/client/src/clientHb.c
source/client/src/clientHb.c
+9
-4
source/client/src/clientMain.c
source/client/src/clientMain.c
+7
-3
tests/script/api/passwdTest.c
tests/script/api/passwdTest.c
+3
-4
未找到文件。
source/client/inc/clientInt.h
浏览文件 @
b059cc4e
...
...
@@ -361,7 +361,7 @@ void stopAllRequests(SHashObj* pRequests);
// conn level
int
hbRegisterConn
(
SAppHbMgr
*
pAppHbMgr
,
int64_t
tscRefId
,
int64_t
clusterId
,
int8_t
connType
);
void
hbDeregisterConn
(
S
AppHbMgr
*
pAppHbMgr
,
SClientHbKey
connKey
,
void
*
param
);
void
hbDeregisterConn
(
S
TscObj
*
pTscObj
,
SClientHbKey
connKey
);
typedef
struct
SSqlCallbackWrapper
{
SParseContext
*
pParseCtx
;
...
...
source/client/src/clientEnv.c
浏览文件 @
b059cc4e
...
...
@@ -239,7 +239,7 @@ void destroyTscObj(void *pObj) {
tscTrace
(
"begin to destroy tscObj %"
PRIx64
" p:%p"
,
tscId
,
pTscObj
);
SClientHbKey
connKey
=
{.
tscRid
=
pTscObj
->
id
,
.
connType
=
pTscObj
->
connType
};
hbDeregisterConn
(
pTscObj
->
pAppInfo
->
pAppHbMgr
,
connKey
,
pTscObj
->
passInfo
.
fp
);
hbDeregisterConn
(
pTscObj
,
connKey
);
destroyAllRequests
(
pTscObj
->
pRequests
);
taosHashCleanup
(
pTscObj
->
pRequests
);
...
...
source/client/src/clientHb.c
浏览文件 @
b059cc4e
...
...
@@ -994,6 +994,7 @@ SAppHbMgr *appHbMgrInit(SAppInstInfo *pAppInstInfo, char *key) {
// init stat
pAppHbMgr
->
startTime
=
taosGetTimestampMs
();
pAppHbMgr
->
connKeyCnt
=
0
;
pAppHbMgr
->
passKeyCnt
=
0
;
pAppHbMgr
->
reportCnt
=
0
;
pAppHbMgr
->
reportBytes
=
0
;
pAppHbMgr
->
key
=
taosStrdup
(
key
);
...
...
@@ -1154,7 +1155,8 @@ int hbRegisterConn(SAppHbMgr *pAppHbMgr, int64_t tscRefId, int64_t clusterId, in
}
}
void
hbDeregisterConn
(
SAppHbMgr
*
pAppHbMgr
,
SClientHbKey
connKey
,
void
*
param
)
{
void
hbDeregisterConn
(
STscObj
*
pTscObj
,
SClientHbKey
connKey
)
{
SAppHbMgr
*
pAppHbMgr
=
pTscObj
->
pAppInfo
->
pAppHbMgr
;
SClientHbReq
*
pReq
=
taosHashAcquire
(
pAppHbMgr
->
activeInfo
,
&
connKey
,
sizeof
(
SClientHbKey
));
if
(
pReq
)
{
tFreeClientHbReq
(
pReq
);
...
...
@@ -1167,7 +1169,10 @@ void hbDeregisterConn(SAppHbMgr *pAppHbMgr, SClientHbKey connKey, void *param) {
}
atomic_sub_fetch_32
(
&
pAppHbMgr
->
connKeyCnt
,
1
);
if
(
param
)
{
atomic_sub_fetch_32
(
&
pAppHbMgr
->
passKeyCnt
,
1
);
taosThreadMutexLock
(
&
pTscObj
->
mutex
);
if
(
pTscObj
->
passInfo
.
fp
)
{
int32_t
cnt
=
atomic_sub_fetch_32
(
&
pAppHbMgr
->
passKeyCnt
,
1
);
}
}
taosThreadMutexUnlock
(
&
pTscObj
->
mutex
);
}
\ No newline at end of file
source/client/src/clientMain.c
浏览文件 @
b059cc4e
...
...
@@ -134,11 +134,15 @@ int taos_set_notify_cb(TAOS *taos, __taos_notify_fn_t fp, void *param, int type)
switch
(
type
)
{
case
TAOS_NOTIFY_PASSVER
:
{
pObj
->
passInfo
.
fp
=
fp
;
pObj
->
passInfo
.
param
=
param
;
if
(
fp
)
{
taosThreadMutexLock
(
&
pObj
->
mutex
);
if
(
fp
&&
!
pObj
->
passInfo
.
fp
)
{
atomic_add_fetch_32
(
&
pObj
->
pAppInfo
->
pAppHbMgr
->
passKeyCnt
,
1
);
}
else
if
(
!
fp
&&
pObj
->
passInfo
.
fp
)
{
atomic_sub_fetch_32
(
&
pObj
->
pAppInfo
->
pAppHbMgr
->
passKeyCnt
,
1
);
}
pObj
->
passInfo
.
fp
=
fp
;
pObj
->
passInfo
.
param
=
param
;
taosThreadMutexUnlock
(
&
pObj
->
mutex
);
break
;
}
default:
{
...
...
tests/script/api/passwdTest.c
浏览文件 @
b059cc4e
...
...
@@ -33,8 +33,7 @@
#define nUser 10
#define USER_LEN 24
void
Test
(
TAOS
*
taos
,
char
*
qstr
);
void
createUers
(
TAOS
*
taos
,
const
char
*
host
,
char
*
qstr
);
void
createUsers
(
TAOS
*
taos
,
const
char
*
host
,
char
*
qstr
);
void
passVerTestMulti
(
const
char
*
host
,
char
*
qstr
);
int
nPassVerNotified
=
0
;
...
...
@@ -98,14 +97,14 @@ int main(int argc, char *argv[]) {
printf
(
"failed to connect to server, reason:%s
\n
"
,
"null taos"
/*taos_errstr(taos)*/
);
exit
(
1
);
}
createUers
(
taos
,
argv
[
1
],
qstr
);
createU
s
ers
(
taos
,
argv
[
1
],
qstr
);
passVerTestMulti
(
argv
[
1
],
qstr
);
taos_close
(
taos
);
taos_cleanup
();
}
void
createUers
(
TAOS
*
taos
,
const
char
*
host
,
char
*
qstr
)
{
void
createU
s
ers
(
TAOS
*
taos
,
const
char
*
host
,
char
*
qstr
)
{
// users
for
(
int
i
=
0
;
i
<
nUser
;
++
i
)
{
sprintf
(
users
[
i
],
"user%d"
,
i
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录