Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
5262b4ad
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看板
提交
5262b4ad
编写于
3月 11, 2022
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify transport
上级
5f51fb3a
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
9 addition
and
23 deletion
+9
-23
include/libs/transport/trpc.h
include/libs/transport/trpc.h
+0
-1
source/client/src/clientEnv.c
source/client/src/clientEnv.c
+1
-2
source/dnode/mgmt/impl/src/dndTransport.c
source/dnode/mgmt/impl/src/dndTransport.c
+5
-6
source/libs/transport/inc/transportInt.h
source/libs/transport/inc/transportInt.h
+0
-1
source/libs/transport/src/rpcMain.c
source/libs/transport/src/rpcMain.c
+0
-1
source/libs/transport/src/trans.c
source/libs/transport/src/trans.c
+0
-1
source/libs/transport/src/transCli.c
source/libs/transport/src/transCli.c
+3
-11
未找到文件。
include/libs/transport/trpc.h
浏览文件 @
5262b4ad
...
@@ -64,7 +64,6 @@ typedef struct SRpcInit {
...
@@ -64,7 +64,6 @@ typedef struct SRpcInit {
int8_t
connType
;
// TAOS_CONN_UDP, TAOS_CONN_TCPC, TAOS_CONN_TCPS
int8_t
connType
;
// TAOS_CONN_UDP, TAOS_CONN_TCPC, TAOS_CONN_TCPS
int
idleTime
;
// milliseconds, 0 means idle timer is disabled
int
idleTime
;
// milliseconds, 0 means idle timer is disabled
bool
noPool
;
// create conn pool or not
// the following is for client app ecurity only
// the following is for client app ecurity only
char
*
user
;
// user name
char
*
user
;
// user name
char
spi
;
// security parameter index
char
spi
;
// security parameter index
...
...
source/client/src/clientEnv.c
浏览文件 @
5262b4ad
...
@@ -72,8 +72,6 @@ static void deregisterRequest(SRequestObj *pRequest) {
...
@@ -72,8 +72,6 @@ static void deregisterRequest(SRequestObj *pRequest) {
taosReleaseRef
(
clientConnRefPool
,
pTscObj
->
id
);
taosReleaseRef
(
clientConnRefPool
,
pTscObj
->
id
);
}
}
// todo close the transporter properly
// todo close the transporter properly
void
closeTransporter
(
STscObj
*
pTscObj
)
{
void
closeTransporter
(
STscObj
*
pTscObj
)
{
if
(
pTscObj
==
NULL
||
pTscObj
->
pAppInfo
->
pTransporter
==
NULL
)
{
if
(
pTscObj
==
NULL
||
pTscObj
->
pAppInfo
->
pTransporter
==
NULL
)
{
...
@@ -241,6 +239,7 @@ void taos_init_imp(void) {
...
@@ -241,6 +239,7 @@ void taos_init_imp(void) {
clientConnRefPool
=
taosOpenRef
(
200
,
destroyTscObj
);
clientConnRefPool
=
taosOpenRef
(
200
,
destroyTscObj
);
clientReqRefPool
=
taosOpenRef
(
40960
,
doDestroyRequest
);
clientReqRefPool
=
taosOpenRef
(
40960
,
doDestroyRequest
);
// transDestroyBuffer(&conn->readBuf);
taosGetAppName
(
appInfo
.
appName
,
NULL
);
taosGetAppName
(
appInfo
.
appName
,
NULL
);
pthread_mutex_init
(
&
appInfo
.
mutex
,
NULL
);
pthread_mutex_init
(
&
appInfo
.
mutex
,
NULL
);
...
...
source/dnode/mgmt/impl/src/dndTransport.c
浏览文件 @
5262b4ad
...
@@ -25,8 +25,8 @@
...
@@ -25,8 +25,8 @@
#include "dndMnode.h"
#include "dndMnode.h"
#include "dndVnodes.h"
#include "dndVnodes.h"
#define INTERNAL_USER
"_dnd"
#define INTERNAL_USER "_dnd"
#define INTERNAL_CKEY
"_key"
#define INTERNAL_CKEY "_key"
#define INTERNAL_SECRET "_pwd"
#define INTERNAL_SECRET "_pwd"
static
void
dndInitMsgFp
(
STransMgmt
*
pMgmt
)
{
static
void
dndInitMsgFp
(
STransMgmt
*
pMgmt
)
{
...
@@ -155,7 +155,7 @@ static void dndInitMsgFp(STransMgmt *pMgmt) {
...
@@ -155,7 +155,7 @@ static void dndInitMsgFp(STransMgmt *pMgmt) {
}
}
static
void
dndProcessResponse
(
void
*
parent
,
SRpcMsg
*
pRsp
,
SEpSet
*
pEpSet
)
{
static
void
dndProcessResponse
(
void
*
parent
,
SRpcMsg
*
pRsp
,
SEpSet
*
pEpSet
)
{
SDnode
*
pDnode
=
parent
;
SDnode
*
pDnode
=
parent
;
STransMgmt
*
pMgmt
=
&
pDnode
->
tmgmt
;
STransMgmt
*
pMgmt
=
&
pDnode
->
tmgmt
;
tmsg_t
msgType
=
pRsp
->
msgType
;
tmsg_t
msgType
=
pRsp
->
msgType
;
...
@@ -193,7 +193,6 @@ static int32_t dndInitClient(SDnode *pDnode) {
...
@@ -193,7 +193,6 @@ static int32_t dndInitClient(SDnode *pDnode) {
rpcInit
.
ckey
=
INTERNAL_CKEY
;
rpcInit
.
ckey
=
INTERNAL_CKEY
;
rpcInit
.
spi
=
1
;
rpcInit
.
spi
=
1
;
rpcInit
.
parent
=
pDnode
;
rpcInit
.
parent
=
pDnode
;
rpcInit
.
noPool
=
true
;
char
pass
[
TSDB_PASSWORD_LEN
+
1
]
=
{
0
};
char
pass
[
TSDB_PASSWORD_LEN
+
1
]
=
{
0
};
taosEncryptPass_c
((
uint8_t
*
)(
INTERNAL_SECRET
),
strlen
(
INTERNAL_SECRET
),
pass
);
taosEncryptPass_c
((
uint8_t
*
)(
INTERNAL_SECRET
),
strlen
(
INTERNAL_SECRET
),
pass
);
...
@@ -219,7 +218,7 @@ static void dndCleanupClient(SDnode *pDnode) {
...
@@ -219,7 +218,7 @@ static void dndCleanupClient(SDnode *pDnode) {
}
}
static
void
dndProcessRequest
(
void
*
param
,
SRpcMsg
*
pReq
,
SEpSet
*
pEpSet
)
{
static
void
dndProcessRequest
(
void
*
param
,
SRpcMsg
*
pReq
,
SEpSet
*
pEpSet
)
{
SDnode
*
pDnode
=
param
;
SDnode
*
pDnode
=
param
;
STransMgmt
*
pMgmt
=
&
pDnode
->
tmgmt
;
STransMgmt
*
pMgmt
=
&
pDnode
->
tmgmt
;
tmsg_t
msgType
=
pReq
->
msgType
;
tmsg_t
msgType
=
pReq
->
msgType
;
...
@@ -313,7 +312,7 @@ static int32_t dndRetrieveUserAuthInfo(void *parent, char *user, char *spi, char
...
@@ -313,7 +312,7 @@ static int32_t dndRetrieveUserAuthInfo(void *parent, char *user, char *spi, char
SAuthReq
authReq
=
{
0
};
SAuthReq
authReq
=
{
0
};
tstrncpy
(
authReq
.
user
,
user
,
TSDB_USER_LEN
);
tstrncpy
(
authReq
.
user
,
user
,
TSDB_USER_LEN
);
int32_t
contLen
=
tSerializeSAuthReq
(
NULL
,
0
,
&
authReq
);
int32_t
contLen
=
tSerializeSAuthReq
(
NULL
,
0
,
&
authReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeSAuthReq
(
pReq
,
contLen
,
&
authReq
);
tSerializeSAuthReq
(
pReq
,
contLen
,
&
authReq
);
SRpcMsg
rpcMsg
=
{.
pCont
=
pReq
,
.
contLen
=
contLen
,
.
msgType
=
TDMT_MND_AUTH
,
.
ahandle
=
(
void
*
)
9528
};
SRpcMsg
rpcMsg
=
{.
pCont
=
pReq
,
.
contLen
=
contLen
,
.
msgType
=
TDMT_MND_AUTH
,
.
ahandle
=
(
void
*
)
9528
};
...
...
source/libs/transport/inc/transportInt.h
浏览文件 @
5262b4ad
...
@@ -54,7 +54,6 @@ typedef struct {
...
@@ -54,7 +54,6 @@ typedef struct {
int8_t
connType
;
int8_t
connType
;
int64_t
index
;
int64_t
index
;
char
label
[
TSDB_LABEL_LEN
];
char
label
[
TSDB_LABEL_LEN
];
bool
noPool
;
// pool or not
char
user
[
TSDB_UNI_LEN
];
// meter ID
char
user
[
TSDB_UNI_LEN
];
// meter ID
char
spi
;
// security parameter index
char
spi
;
// security parameter index
...
...
source/libs/transport/src/rpcMain.c
浏览文件 @
5262b4ad
...
@@ -64,7 +64,6 @@ typedef struct {
...
@@ -64,7 +64,6 @@ typedef struct {
void
(
*
cfp
)(
void
*
parent
,
SRpcMsg
*
,
SEpSet
*
);
void
(
*
cfp
)(
void
*
parent
,
SRpcMsg
*
,
SEpSet
*
);
int
(
*
afp
)(
void
*
parent
,
char
*
user
,
char
*
spi
,
char
*
encrypt
,
char
*
secret
,
char
*
ckey
);
int
(
*
afp
)(
void
*
parent
,
char
*
user
,
char
*
spi
,
char
*
encrypt
,
char
*
secret
,
char
*
ckey
);
bool
noPool
;
int32_t
refCount
;
int32_t
refCount
;
void
*
parent
;
void
*
parent
;
void
*
idPool
;
// handle to ID pool
void
*
idPool
;
// handle to ID pool
...
...
source/libs/transport/src/trans.c
浏览文件 @
5262b4ad
...
@@ -41,7 +41,6 @@ void* rpcOpen(const SRpcInit* pInit) {
...
@@ -41,7 +41,6 @@ void* rpcOpen(const SRpcInit* pInit) {
pRpc
->
numOfThreads
=
pInit
->
numOfThreads
;
pRpc
->
numOfThreads
=
pInit
->
numOfThreads
;
}
}
pRpc
->
noPool
=
pInit
->
noPool
;
pRpc
->
connType
=
pInit
->
connType
;
pRpc
->
connType
=
pInit
->
connType
;
pRpc
->
idleTime
=
pInit
->
idleTime
;
pRpc
->
idleTime
=
pInit
->
idleTime
;
pRpc
->
tcphandle
=
(
*
taosInitHandle
[
pRpc
->
connType
])(
0
,
pInit
->
localPort
,
pRpc
->
label
,
pRpc
->
numOfThreads
,
NULL
,
pRpc
);
pRpc
->
tcphandle
=
(
*
taosInitHandle
[
pRpc
->
connType
])(
0
,
pInit
->
localPort
,
pRpc
->
label
,
pRpc
->
numOfThreads
,
NULL
,
pRpc
);
...
...
source/libs/transport/src/transCli.c
浏览文件 @
5262b4ad
...
@@ -170,13 +170,7 @@ static void clientHandleResp(SCliConn* conn) {
...
@@ -170,13 +170,7 @@ static void clientHandleResp(SCliConn* conn) {
// user owns conn->persist = 1
// user owns conn->persist = 1
if
(
conn
->
persist
==
0
)
{
if
(
conn
->
persist
==
0
)
{
if
(
pTransInst
->
noPool
==
true
)
{
addConnToPool
(
pThrd
->
pool
,
pCtx
->
ip
,
pCtx
->
port
,
conn
);
destroyCmsg
(
conn
->
data
);
clientConnDestroy
(
conn
,
true
);
return
;
}
else
{
addConnToPool
(
pThrd
->
pool
,
pCtx
->
ip
,
pCtx
->
port
,
conn
);
}
}
}
destroyCmsg
(
conn
->
data
);
destroyCmsg
(
conn
->
data
);
conn
->
data
=
NULL
;
conn
->
data
=
NULL
;
...
@@ -463,10 +457,8 @@ static void clientHandleReq(SCliMsg* pMsg, SCliThrdObj* pThrd) {
...
@@ -463,10 +457,8 @@ static void clientHandleReq(SCliMsg* pMsg, SCliThrdObj* pThrd) {
tTrace
(
"%s client conn %p reused"
,
CONN_GET_INST_LABEL
(
conn
),
conn
);
tTrace
(
"%s client conn %p reused"
,
CONN_GET_INST_LABEL
(
conn
),
conn
);
}
}
}
else
{
}
else
{
if
(
pTransInst
->
noPool
==
false
)
{
conn
=
getConnFromPool
(
pThrd
->
pool
,
pCtx
->
ip
,
pCtx
->
port
);
conn
=
getConnFromPool
(
pThrd
->
pool
,
pCtx
->
ip
,
pCtx
->
port
);
if
(
conn
!=
NULL
)
tTrace
(
"%s client conn %p get from conn pool"
,
CONN_GET_INST_LABEL
(
conn
),
conn
);
if
(
conn
!=
NULL
)
tTrace
(
"%s client conn %p get from conn pool"
,
CONN_GET_INST_LABEL
(
conn
),
conn
);
}
}
}
if
(
conn
!=
NULL
)
{
if
(
conn
!=
NULL
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录