Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
7ad701cc
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看板
提交
7ad701cc
编写于
12月 30, 2021
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-11818] add rsp error check.
上级
07a36808
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
34 addition
and
19 deletion
+34
-19
source/client/src/clientMsgHandler.c
source/client/src/clientMsgHandler.c
+34
-19
未找到文件。
source/client/src/clientMsgHandler.c
浏览文件 @
7ad701cc
...
@@ -22,19 +22,23 @@
...
@@ -22,19 +22,23 @@
int
(
*
handleRequestRspFp
[
TDMT_MAX
])(
void
*
,
const
SDataBuf
*
pMsg
,
int32_t
code
);
int
(
*
handleRequestRspFp
[
TDMT_MAX
])(
void
*
,
const
SDataBuf
*
pMsg
,
int32_t
code
);
static
void
setErrno
(
SRequestObj
*
pRequest
,
int32_t
code
)
{
pRequest
->
code
=
code
;
terrno
=
code
;
}
int
genericRspCallback
(
void
*
param
,
const
SDataBuf
*
pMsg
,
int32_t
code
)
{
int
genericRspCallback
(
void
*
param
,
const
SDataBuf
*
pMsg
,
int32_t
code
)
{
SRequestObj
*
pRequest
=
param
;
SRequestObj
*
pRequest
=
param
;
pRequest
->
code
=
code
;
setErrno
(
pRequest
,
code
);
sem_post
(
&
pRequest
->
body
.
rspSem
);
sem_post
(
&
pRequest
->
body
.
rspSem
);
return
0
;
return
code
;
}
}
int
processConnectRsp
(
void
*
param
,
const
SDataBuf
*
pMsg
,
int32_t
code
)
{
int
processConnectRsp
(
void
*
param
,
const
SDataBuf
*
pMsg
,
int32_t
code
)
{
SRequestObj
*
pRequest
=
param
;
SRequestObj
*
pRequest
=
param
;
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
pRequest
->
code
=
code
;
setErrno
(
pRequest
,
code
);
terrno
=
code
;
sem_post
(
&
pRequest
->
body
.
rspSem
);
sem_post
(
&
pRequest
->
body
.
rspSem
);
return
code
;
return
code
;
}
}
...
@@ -115,7 +119,7 @@ SMsgSendInfo* buildSendMsgInfoImpl(SRequestObj *pRequest) {
...
@@ -115,7 +119,7 @@ SMsgSendInfo* buildSendMsgInfoImpl(SRequestObj *pRequest) {
int32_t
processShowRsp
(
void
*
param
,
const
SDataBuf
*
pMsg
,
int32_t
code
)
{
int32_t
processShowRsp
(
void
*
param
,
const
SDataBuf
*
pMsg
,
int32_t
code
)
{
SRequestObj
*
pRequest
=
param
;
SRequestObj
*
pRequest
=
param
;
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
pRequest
->
code
=
code
;
setErrno
(
pRequest
,
code
)
;
tsem_post
(
&
pRequest
->
body
.
rspSem
);
tsem_post
(
&
pRequest
->
body
.
rspSem
);
return
code
;
return
code
;
}
}
...
@@ -157,19 +161,18 @@ int32_t processShowRsp(void* param, const SDataBuf* pMsg, int32_t code) {
...
@@ -157,19 +161,18 @@ int32_t processShowRsp(void* param, const SDataBuf* pMsg, int32_t code) {
}
}
int32_t
processRetrieveMnodeRsp
(
void
*
param
,
const
SDataBuf
*
pMsg
,
int32_t
code
)
{
int32_t
processRetrieveMnodeRsp
(
void
*
param
,
const
SDataBuf
*
pMsg
,
int32_t
code
)
{
assert
(
pMsg
->
len
>=
sizeof
(
SRetrieveTableRsp
));
SRequestObj
*
pRequest
=
param
;
SReqResultInfo
*
pResInfo
=
&
pRequest
->
body
.
resInfo
;
SRequestObj
*
pRequest
=
param
;
SReqResultInfo
*
pResInfo
=
&
pRequest
->
body
.
resInfo
;
tfree
(
pResInfo
->
pRspMsg
);
tfree
(
pResInfo
->
pRspMsg
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
pRequest
->
code
=
code
;
setErrno
(
pRequest
,
code
);
terrno
=
code
;
tsem_post
(
&
pRequest
->
body
.
rspSem
);
tsem_post
(
&
pRequest
->
body
.
rspSem
);
return
code
;
return
code
;
}
}
assert
(
pMsg
->
len
>=
sizeof
(
SRetrieveTableRsp
));
SRetrieveTableRsp
*
pRetrieve
=
(
SRetrieveTableRsp
*
)
pMsg
->
pData
;
SRetrieveTableRsp
*
pRetrieve
=
(
SRetrieveTableRsp
*
)
pMsg
->
pData
;
pRetrieve
->
numOfRows
=
htonl
(
pRetrieve
->
numOfRows
);
pRetrieve
->
numOfRows
=
htonl
(
pRetrieve
->
numOfRows
);
pRetrieve
->
precision
=
htons
(
pRetrieve
->
precision
);
pRetrieve
->
precision
=
htons
(
pRetrieve
->
precision
);
...
@@ -195,8 +198,7 @@ int32_t processRetrieveVndRsp(void* param, const SDataBuf* pMsg, int32_t code) {
...
@@ -195,8 +198,7 @@ int32_t processRetrieveVndRsp(void* param, const SDataBuf* pMsg, int32_t code) {
tfree
(
pRequest
->
body
.
resInfo
.
pRspMsg
);
tfree
(
pRequest
->
body
.
resInfo
.
pRspMsg
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
pRequest
->
code
=
code
;
setErrno
(
pRequest
,
code
);
terrno
=
code
;
tsem_post
(
&
pRequest
->
body
.
rspSem
);
tsem_post
(
&
pRequest
->
body
.
rspSem
);
return
code
;
return
code
;
}
}
...
@@ -209,7 +211,6 @@ int32_t processRetrieveVndRsp(void* param, const SDataBuf* pMsg, int32_t code) {
...
@@ -209,7 +211,6 @@ int32_t processRetrieveVndRsp(void* param, const SDataBuf* pMsg, int32_t code) {
SReqResultInfo
*
pResInfo
=
&
pRequest
->
body
.
resInfo
;
SReqResultInfo
*
pResInfo
=
&
pRequest
->
body
.
resInfo
;
tfree
(
pResInfo
->
pRspMsg
);
pResInfo
->
pRspMsg
=
pMsg
->
pData
;
pResInfo
->
pRspMsg
=
pMsg
->
pData
;
pResInfo
->
numOfRows
=
pFetchRsp
->
numOfRows
;
pResInfo
->
numOfRows
=
pFetchRsp
->
numOfRows
;
pResInfo
->
pData
=
pFetchRsp
->
data
;
pResInfo
->
pData
=
pFetchRsp
->
data
;
...
@@ -231,6 +232,14 @@ int32_t processCreateDbRsp(void* param, const SDataBuf* pMsg, int32_t code) {
...
@@ -231,6 +232,14 @@ int32_t processCreateDbRsp(void* param, const SDataBuf* pMsg, int32_t code) {
}
}
int32_t
processUseDbRsp
(
void
*
param
,
const
SDataBuf
*
pMsg
,
int32_t
code
)
{
int32_t
processUseDbRsp
(
void
*
param
,
const
SDataBuf
*
pMsg
,
int32_t
code
)
{
SRequestObj
*
pRequest
=
param
;
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
setErrno
(
pRequest
,
code
);
tsem_post
(
&
pRequest
->
body
.
rspSem
);
return
code
;
}
SUseDbRsp
*
pUseDbRsp
=
(
SUseDbRsp
*
)
pMsg
->
pData
;
SUseDbRsp
*
pUseDbRsp
=
(
SUseDbRsp
*
)
pMsg
->
pData
;
SName
name
=
{
0
};
SName
name
=
{
0
};
tNameFromString
(
&
name
,
pUseDbRsp
->
db
,
T_NAME_ACCT
|
T_NAME_DB
);
tNameFromString
(
&
name
,
pUseDbRsp
->
db
,
T_NAME_ACCT
|
T_NAME_DB
);
...
@@ -238,17 +247,23 @@ int32_t processUseDbRsp(void* param, const SDataBuf* pMsg, int32_t code) {
...
@@ -238,17 +247,23 @@ int32_t processUseDbRsp(void* param, const SDataBuf* pMsg, int32_t code) {
char
db
[
TSDB_DB_NAME_LEN
]
=
{
0
};
char
db
[
TSDB_DB_NAME_LEN
]
=
{
0
};
tNameGetDbName
(
&
name
,
db
);
tNameGetDbName
(
&
name
,
db
);
SRequestObj
*
pRequest
=
param
;
setConnectionDB
(
pRequest
->
pTscObj
,
db
);
setConnectionDB
(
pRequest
->
pTscObj
,
db
);
tsem_post
(
&
pRequest
->
body
.
rspSem
);
tsem_post
(
&
pRequest
->
body
.
rspSem
);
return
0
;
return
0
;
}
}
int32_t
processCreateTableRsp
(
void
*
param
,
const
SDataBuf
*
pMsg
,
int32_t
code
)
{
int32_t
processCreateTableRsp
(
void
*
param
,
const
SDataBuf
*
pMsg
,
int32_t
code
)
{
assert
(
pMsg
!=
NULL
);
assert
(
pMsg
!=
NULL
&&
param
!=
NULL
);
SRequestObj
*
pRequest
=
param
;
SRequestObj
*
pRequest
=
param
;
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
setErrno
(
pRequest
,
code
);
tsem_post
(
&
pRequest
->
body
.
rspSem
);
return
code
;
}
tsem_post
(
&
pRequest
->
body
.
rspSem
);
tsem_post
(
&
pRequest
->
body
.
rspSem
);
return
code
;
}
}
int32_t
processDropDbRsp
(
void
*
param
,
const
SDataBuf
*
pMsg
,
int32_t
code
)
{
int32_t
processDropDbRsp
(
void
*
param
,
const
SDataBuf
*
pMsg
,
int32_t
code
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录