Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
22b87dc2
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1193
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看板
提交
22b87dc2
编写于
3月 29, 2023
作者:
C
cademfly
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
UserAuthRsp
上级
8309718a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
75 addition
and
0 deletion
+75
-0
source/common/src/tmsg.c
source/common/src/tmsg.c
+75
-0
未找到文件。
source/common/src/tmsg.c
浏览文件 @
22b87dc2
...
@@ -1445,9 +1445,14 @@ int32_t tSerializeSGetUserAuthRspImpl(SEncoder *pEncoder, SGetUserAuthRsp *pRsp)
...
@@ -1445,9 +1445,14 @@ int32_t tSerializeSGetUserAuthRspImpl(SEncoder *pEncoder, SGetUserAuthRsp *pRsp)
int32_t
numOfCreatedDbs
=
taosHashGetSize
(
pRsp
->
createdDbs
);
int32_t
numOfCreatedDbs
=
taosHashGetSize
(
pRsp
->
createdDbs
);
int32_t
numOfReadDbs
=
taosHashGetSize
(
pRsp
->
readDbs
);
int32_t
numOfReadDbs
=
taosHashGetSize
(
pRsp
->
readDbs
);
int32_t
numOfWriteDbs
=
taosHashGetSize
(
pRsp
->
writeDbs
);
int32_t
numOfWriteDbs
=
taosHashGetSize
(
pRsp
->
writeDbs
);
int32_t
numOfReadTbs
=
taosHashGetSize
(
pRsp
->
readTbs
);
int32_t
numOfWriteTbs
=
taosHashGetSize
(
pRsp
->
writeTbs
);
if
(
tEncodeI32
(
pEncoder
,
numOfCreatedDbs
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
pEncoder
,
numOfCreatedDbs
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
pEncoder
,
numOfReadDbs
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
pEncoder
,
numOfReadDbs
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
pEncoder
,
numOfWriteDbs
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
pEncoder
,
numOfWriteDbs
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
pEncoder
,
numOfReadTbs
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
pEncoder
,
numOfWriteTbs
)
<
0
)
return
-
1
;
char
*
db
=
taosHashIterate
(
pRsp
->
createdDbs
,
NULL
);
char
*
db
=
taosHashIterate
(
pRsp
->
createdDbs
,
NULL
);
while
(
db
!=
NULL
)
{
while
(
db
!=
NULL
)
{
...
@@ -1467,6 +1472,36 @@ int32_t tSerializeSGetUserAuthRspImpl(SEncoder *pEncoder, SGetUserAuthRsp *pRsp)
...
@@ -1467,6 +1472,36 @@ int32_t tSerializeSGetUserAuthRspImpl(SEncoder *pEncoder, SGetUserAuthRsp *pRsp)
db
=
taosHashIterate
(
pRsp
->
writeDbs
,
db
);
db
=
taosHashIterate
(
pRsp
->
writeDbs
,
db
);
}
}
char
*
tb
=
taosHashIterate
(
pRsp
->
readTbs
,
NULL
);
while
(
tb
!=
NULL
)
{
size_t
keyLen
=
0
;
void
*
key
=
taosHashGetKey
(
tb
,
&
keyLen
);
if
(
tEncodeI32
(
pEncoder
,
keyLen
)
<
0
)
return
-
1
;
if
(
tEncodeCStr
(
pEncoder
,
key
)
<
0
)
return
-
1
;
size_t
valueLen
=
0
;
valueLen
=
strlen
(
tb
);
if
(
tEncodeI32
(
pEncoder
,
valueLen
)
<
0
)
return
-
1
;
if
(
tEncodeCStr
(
pEncoder
,
tb
)
<
0
)
return
-
1
;
tb
=
taosHashIterate
(
pRsp
->
readTbs
,
tb
);
}
tb
=
taosHashIterate
(
pRsp
->
writeTbs
,
NULL
);
while
(
tb
!=
NULL
)
{
size_t
keyLen
=
0
;
void
*
key
=
taosHashGetKey
(
tb
,
&
keyLen
);
if
(
tEncodeI32
(
pEncoder
,
keyLen
)
<
0
)
return
-
1
;
if
(
tEncodeCStr
(
pEncoder
,
key
)
<
0
)
return
-
1
;
size_t
valueLen
=
0
;
valueLen
=
strlen
(
tb
);
if
(
tEncodeI32
(
pEncoder
,
valueLen
)
<
0
)
return
-
1
;
if
(
tEncodeCStr
(
pEncoder
,
tb
)
<
0
)
return
-
1
;
tb
=
taosHashIterate
(
pRsp
->
writeTbs
,
tb
);
}
return
0
;
return
0
;
}
}
...
@@ -1503,9 +1538,13 @@ int32_t tDeserializeSGetUserAuthRspImpl(SDecoder *pDecoder, SGetUserAuthRsp *pRs
...
@@ -1503,9 +1538,13 @@ int32_t tDeserializeSGetUserAuthRspImpl(SDecoder *pDecoder, SGetUserAuthRsp *pRs
int32_t
numOfCreatedDbs
=
0
;
int32_t
numOfCreatedDbs
=
0
;
int32_t
numOfReadDbs
=
0
;
int32_t
numOfReadDbs
=
0
;
int32_t
numOfWriteDbs
=
0
;
int32_t
numOfWriteDbs
=
0
;
int32_t
numOfReadTbs
=
0
;
int32_t
numOfWriteTbs
=
0
;
if
(
tDecodeI32
(
pDecoder
,
&
numOfCreatedDbs
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
pDecoder
,
&
numOfCreatedDbs
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
pDecoder
,
&
numOfReadDbs
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
pDecoder
,
&
numOfReadDbs
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
pDecoder
,
&
numOfWriteDbs
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
pDecoder
,
&
numOfWriteDbs
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
pDecoder
,
&
numOfReadTbs
)
<
0
)
return
-
1
;
if
(
tDecodeI32
(
pDecoder
,
&
numOfWriteTbs
)
<
0
)
return
-
1
;
for
(
int32_t
i
=
0
;
i
<
numOfCreatedDbs
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
numOfCreatedDbs
;
++
i
)
{
char
db
[
TSDB_DB_FNAME_LEN
]
=
{
0
};
char
db
[
TSDB_DB_FNAME_LEN
]
=
{
0
};
...
@@ -1528,6 +1567,42 @@ int32_t tDeserializeSGetUserAuthRspImpl(SDecoder *pDecoder, SGetUserAuthRsp *pRs
...
@@ -1528,6 +1567,42 @@ int32_t tDeserializeSGetUserAuthRspImpl(SDecoder *pDecoder, SGetUserAuthRsp *pRs
taosHashPut
(
pRsp
->
writeDbs
,
db
,
len
,
db
,
len
);
taosHashPut
(
pRsp
->
writeDbs
,
db
,
len
,
db
,
len
);
}
}
for
(
int32_t
i
=
0
;
i
<
numOfReadTbs
;
++
i
)
{
int32_t
keyLen
=
0
;
if
(
tDecodeI32
(
pDecoder
,
&
keyLen
)
<
0
)
return
-
1
;
char
*
key
=
taosMemoryCalloc
(
keyLen
+
1
,
sizeof
(
char
));
if
(
tDecodeCStrTo
(
pDecoder
,
key
)
<
0
)
return
-
1
;
int32_t
valuelen
=
0
;
if
(
tDecodeI32
(
pDecoder
,
&
valuelen
)
<
0
)
return
-
1
;
char
*
value
=
taosMemoryCalloc
(
valuelen
+
1
,
sizeof
(
char
));
if
(
tDecodeCStrTo
(
pDecoder
,
value
)
<
0
)
return
-
1
;
taosHashPut
(
pRsp
->
readTbs
,
key
,
keyLen
,
value
,
valuelen
);
taosMemoryFree
(
key
);
taosMemoryFree
(
value
);
}
for
(
int32_t
i
=
0
;
i
<
numOfWriteTbs
;
++
i
)
{
int32_t
keyLen
=
0
;
if
(
tDecodeI32
(
pDecoder
,
&
keyLen
)
<
0
)
return
-
1
;
char
*
key
=
taosMemoryCalloc
(
keyLen
+
1
,
sizeof
(
char
));
if
(
tDecodeCStrTo
(
pDecoder
,
key
)
<
0
)
return
-
1
;
int32_t
valuelen
=
0
;
if
(
tDecodeI32
(
pDecoder
,
&
valuelen
)
<
0
)
return
-
1
;
char
*
value
=
taosMemoryCalloc
(
valuelen
+
1
,
sizeof
(
char
));
if
(
tDecodeCStrTo
(
pDecoder
,
value
)
<
0
)
return
-
1
;
taosHashPut
(
pRsp
->
writeTbs
,
key
,
keyLen
,
value
,
valuelen
);
taosMemoryFree
(
key
);
taosMemoryFree
(
value
);
}
return
0
;
return
0
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录