Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
2fd97f4c
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看板
提交
2fd97f4c
编写于
1月 24, 2022
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
handle close except
上级
b34a5bdf
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
33 addition
and
4 deletion
+33
-4
source/libs/transport/inc/transComm.h
source/libs/transport/inc/transComm.h
+2
-1
source/libs/transport/src/transCli.c
source/libs/transport/src/transCli.c
+20
-3
source/libs/transport/src/transComm.c
source/libs/transport/src/transComm.c
+7
-0
source/libs/transport/src/transSrv.c
source/libs/transport/src/transSrv.c
+4
-0
未找到文件。
source/libs/transport/inc/transComm.h
浏览文件 @
2fd97f4c
...
@@ -182,7 +182,7 @@ typedef struct {
...
@@ -182,7 +182,7 @@ typedef struct {
#define TRANS_RESERVE_SIZE (sizeof(STranConnCtx))
#define TRANS_RESERVE_SIZE (sizeof(STranConnCtx))
#define TRANS_MSG_OVERHEAD (sizeof(STransMsgHead)
+ sizeof(STransDigestMsg)
)
#define TRANS_MSG_OVERHEAD (sizeof(STransMsgHead))
#define transHeadFromCont(cont) ((STransMsgHead*)((char*)cont - sizeof(STransMsgHead)))
#define transHeadFromCont(cont) ((STransMsgHead*)((char*)cont - sizeof(STransMsgHead)))
#define transContFromHead(msg) (msg + sizeof(STransMsgHead))
#define transContFromHead(msg) (msg + sizeof(STransMsgHead))
#define transMsgLenFromCont(contLen) (contLen + sizeof(STransMsgHead))
#define transMsgLenFromCont(contLen) (contLen + sizeof(STransMsgHead))
...
@@ -201,6 +201,7 @@ bool transDecompressMsg(char* msg, int32_t len, int32_t* flen);
...
@@ -201,6 +201,7 @@ bool transDecompressMsg(char* msg, int32_t len, int32_t* flen);
void
transConnCtxDestroy
(
STransConnCtx
*
ctx
);
void
transConnCtxDestroy
(
STransConnCtx
*
ctx
);
void
transFreeMsg
(
void
*
msg
);
typedef
struct
SConnBuffer
{
typedef
struct
SConnBuffer
{
char
*
buf
;
char
*
buf
;
int
len
;
int
len
;
...
...
source/libs/transport/src/transCli.c
浏览文件 @
2fd97f4c
...
@@ -107,8 +107,17 @@ static void clientHandleResp(SCliConn* conn) {
...
@@ -107,8 +107,17 @@ static void clientHandleResp(SCliConn* conn) {
SRpcInfo
*
pRpc
=
pCtx
->
pTransInst
;
SRpcInfo
*
pRpc
=
pCtx
->
pTransInst
;
SRpcMsg
rpcMsg
;
SRpcMsg
rpcMsg
;
rpcMsg
.
pCont
=
conn
->
readBuf
.
buf
;
STransMsgHead
*
pHead
=
(
STransMsgHead
*
)(
conn
->
readBuf
.
buf
);
rpcMsg
.
contLen
=
conn
->
readBuf
.
len
;
pHead
->
code
=
htonl
(
pHead
->
code
);
pHead
->
msgLen
=
htonl
(
pHead
->
msgLen
);
rpcMsg
.
contLen
=
transContLenFromMsg
(
pHead
->
msgLen
);
rpcMsg
.
pCont
=
transContFromHead
(
pHead
);
rpcMsg
.
code
=
pHead
->
code
;
rpcMsg
.
msgType
=
pHead
->
msgType
;
// rpcMsg.pCont = conn->readBuf.buf;
// rpcMsg.contLen = conn->readBuf.len;
rpcMsg
.
ahandle
=
pCtx
->
ahandle
;
rpcMsg
.
ahandle
=
pCtx
->
ahandle
;
(
pRpc
->
cfp
)(
NULL
,
&
rpcMsg
,
NULL
);
(
pRpc
->
cfp
)(
NULL
,
&
rpcMsg
,
NULL
);
conn
->
notifyCount
+=
1
;
conn
->
notifyCount
+=
1
;
...
@@ -128,8 +137,12 @@ static void clientHandleExcept(SCliConn* pConn) {
...
@@ -128,8 +137,12 @@ static void clientHandleExcept(SCliConn* pConn) {
STransConnCtx
*
pCtx
=
pMsg
->
ctx
;
STransConnCtx
*
pCtx
=
pMsg
->
ctx
;
SRpcInfo
*
pRpc
=
pCtx
->
pTransInst
;
SRpcInfo
*
pRpc
=
pCtx
->
pTransInst
;
SRpcMsg
rpcMsg
;
transFreeMsg
((
pMsg
->
msg
.
pCont
));
pMsg
->
msg
.
pCont
=
NULL
;
SRpcMsg
rpcMsg
=
{
0
};
rpcMsg
.
ahandle
=
pCtx
->
ahandle
;
rpcMsg
.
ahandle
=
pCtx
->
ahandle
;
rpcMsg
.
code
=
-
1
;
// SRpcInfo* pRpc = pMsg->ctx->pRpc;
// SRpcInfo* pRpc = pMsg->ctx->pRpc;
(
pRpc
->
cfp
)(
NULL
,
&
rpcMsg
,
NULL
);
(
pRpc
->
cfp
)(
NULL
,
&
rpcMsg
,
NULL
);
...
@@ -306,6 +319,10 @@ static void clientDestroy(uv_handle_t* handle) {
...
@@ -306,6 +319,10 @@ static void clientDestroy(uv_handle_t* handle) {
static
void
clientWriteCb
(
uv_write_t
*
req
,
int
status
)
{
static
void
clientWriteCb
(
uv_write_t
*
req
,
int
status
)
{
SCliConn
*
pConn
=
req
->
data
;
SCliConn
*
pConn
=
req
->
data
;
SCliMsg
*
pMsg
=
pConn
->
data
;
transFreeMsg
((
pMsg
->
msg
.
pCont
));
pMsg
->
msg
.
pCont
=
NULL
;
if
(
status
==
0
)
{
if
(
status
==
0
)
{
tDebug
(
"conn %p data already was written out"
,
pConn
);
tDebug
(
"conn %p data already was written out"
,
pConn
);
}
else
{
}
else
{
...
...
source/libs/transport/src/transComm.c
浏览文件 @
2fd97f4c
...
@@ -191,4 +191,11 @@ void transConnCtxDestroy(STransConnCtx* ctx) {
...
@@ -191,4 +191,11 @@ void transConnCtxDestroy(STransConnCtx* ctx) {
free
(
ctx
->
ip
);
free
(
ctx
->
ip
);
free
(
ctx
);
free
(
ctx
);
}
}
void
transFreeMsg
(
void
*
msg
)
{
if
(
msg
==
NULL
)
{
return
;
}
free
((
char
*
)
msg
-
sizeof
(
STransMsgHead
));
}
#endif
#endif
source/libs/transport/src/transSrv.c
浏览文件 @
2fd97f4c
...
@@ -321,6 +321,10 @@ void uvOnWriteCb(uv_write_t* req, int status) {
...
@@ -321,6 +321,10 @@ void uvOnWriteCb(uv_write_t* req, int status) {
buf
->
len
=
0
;
buf
->
len
=
0
;
memset
(
buf
->
buf
,
0
,
buf
->
cap
);
memset
(
buf
->
buf
,
0
,
buf
->
cap
);
buf
->
left
=
-
1
;
buf
->
left
=
-
1
;
SRpcMsg
*
pMsg
=
&
conn
->
sendMsg
;
transFreeMsg
(
pMsg
->
pCont
);
if
(
status
==
0
)
{
if
(
status
==
0
)
{
tDebug
(
"conn %p data already was written on stream"
,
conn
);
tDebug
(
"conn %p data already was written on stream"
,
conn
);
}
else
{
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录