Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e657b37e
T
TDengine
项目概览
taosdata
/
TDengine
12 个月 前同步成功
通知
1181
Star
22014
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e657b37e
编写于
3月 20, 2022
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
handle except
上级
843477e3
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
22 addition
and
30 deletion
+22
-30
source/libs/transport/src/transSrv.c
source/libs/transport/src/transSrv.c
+22
-30
未找到文件。
source/libs/transport/src/transSrv.c
浏览文件 @
e657b37e
...
...
@@ -168,34 +168,20 @@ static void uvHandleActivityTimeout(uv_timer_t* handle) {
}
static
void
uvHandleReq
(
SSrvConn
*
pConn
)
{
SRecvInfo
info
;
SRecvInfo
*
p
=
&
info
;
SConnBuffer
*
pBuf
=
&
pConn
->
readBuf
;
p
->
msg
=
pBuf
->
buf
;
p
->
msgLen
=
pBuf
->
len
;
p
->
ip
=
0
;
p
->
port
=
0
;
p
->
shandle
=
pConn
->
pTransInst
;
//
p
->
thandle
=
pConn
;
p
->
chandle
=
NULL
;
STransMsgHead
*
pHead
=
(
STransMsgHead
*
)
p
->
msg
;
char
*
msg
=
pBuf
->
buf
;
uint32_t
msgLen
=
pBuf
->
len
;
STransMsgHead
*
pHead
=
(
STransMsgHead
*
)
msg
;
if
(
pHead
->
secured
==
1
)
{
STransUserMsg
*
uMsg
=
(
STransUserMsg
*
)((
char
*
)
p
->
msg
+
p
->
msgLen
-
sizeof
(
STransUserMsg
));
STransUserMsg
*
uMsg
=
(
STransUserMsg
*
)((
char
*
)
msg
+
msgLen
-
sizeof
(
STransUserMsg
));
memcpy
(
pConn
->
user
,
uMsg
->
user
,
tListLen
(
uMsg
->
user
));
memcpy
(
pConn
->
secret
,
uMsg
->
secret
,
tListLen
(
uMsg
->
secret
));
}
pHead
->
code
=
htonl
(
pHead
->
code
);
int32_t
dlen
=
0
;
if
(
transDecompressMsg
(
NULL
,
0
,
NULL
))
{
// add compress later
// pHead = rpcDecompresSTransMsg(pHead);
}
else
{
pHead
->
msgLen
=
htonl
(
pHead
->
msgLen
);
if
(
pHead
->
secured
==
1
)
{
pHead
->
msgLen
-=
sizeof
(
STransUserMsg
);
}
pHead
->
msgLen
=
htonl
(
pHead
->
msgLen
);
if
(
pHead
->
secured
==
1
)
{
pHead
->
msgLen
-=
sizeof
(
STransUserMsg
);
}
CONN_SHOULD_RELEASE
(
pConn
,
pHead
);
...
...
@@ -232,7 +218,7 @@ static void uvHandleReq(SSrvConn* pConn) {
transMsg
.
handle
=
pConn
;
}
STrans
*
pTransInst
=
(
STrans
*
)
p
->
shandle
;
STrans
*
pTransInst
=
pConn
->
hostThrd
;
(
*
pTransInst
->
cfp
)(
pTransInst
->
parent
,
&
transMsg
,
NULL
);
// uv_timer_start(&pConn->pTimer, uvHandleActivityTimeout, pRpc->idleTime * 10000, 0);
}
...
...
@@ -341,21 +327,27 @@ static void uvPrepareSendData(SSrvMsg* smsg, uv_buf_t* wb) {
}
STransMsgHead
*
pHead
=
transHeadFromCont
(
pMsg
->
pCont
);
pHead
->
secured
=
pMsg
->
code
==
0
?
1
:
0
;
//
pHead
->
msgType
=
smsg
->
pConn
->
inType
+
1
;
// pHead->secured = pMsg->code == 0 ? 1 : 0; //
if
(
!
pConn
->
secured
)
{
pConn
->
secured
=
pMsg
->
code
==
0
?
1
:
0
;
}
pHead
->
secured
=
pConn
->
secured
;
if
(
pConn
->
status
==
ConnNormal
)
{
pHead
->
msgType
=
pConn
->
inType
+
1
;
}
else
{
pHead
->
msgType
=
smsg
->
type
==
Release
?
0
:
pMsg
->
msgType
;
}
pHead
->
release
=
smsg
->
type
==
Release
?
1
:
0
;
pHead
->
code
=
htonl
(
pMsg
->
code
);
// add more info
char
*
msg
=
(
char
*
)
pHead
;
int32_t
len
=
transMsgLenFromCont
(
pMsg
->
contLen
);
if
(
transCompressMsg
(
msg
,
len
,
NULL
))
{
// impl later
}
tDebug
(
"server conn %p %s is sent to %s:%d, local info: %s:%d"
,
pConn
,
TMSG_INFO
(
pHead
->
msgType
),
taosInetNtoa
(
pConn
->
addr
.
sin_addr
),
ntohs
(
pConn
->
addr
.
sin_port
),
taosInetNtoa
(
pConn
->
locaddr
.
sin_addr
),
ntohs
(
pConn
->
locaddr
.
sin_port
));
pHead
->
msgLen
=
htonl
(
len
);
wb
->
base
=
msg
;
wb
->
len
=
len
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录