Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
d774aa39
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1185
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d774aa39
编写于
12月 11, 2019
作者:
S
slguan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TBASE-1241]
上级
1475d520
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
26 addition
and
20 deletion
+26
-20
src/client/src/tscServer.c
src/client/src/tscServer.c
+0
-3
src/inc/taosmsg.h
src/inc/taosmsg.h
+8
-6
src/rpc/src/trpc.c
src/rpc/src/trpc.c
+2
-0
src/system/detail/inc/mgmt.h
src/system/detail/inc/mgmt.h
+2
-1
src/system/detail/src/mgmtShell.c
src/system/detail/src/mgmtShell.c
+14
-10
未找到文件。
src/client/src/tscServer.c
浏览文件 @
d774aa39
...
...
@@ -2643,9 +2643,6 @@ int tscBuildConnectMsg(SSqlObj *pSql) {
strcpy
(
pConnect
->
db
,
db
);
strcpy
(
pConnect
->
clientVersion
,
version
);
pConnect
->
usePublicIp
=
(
int8_t
)
tsUsePublicIp
;
pConnect
->
isCluster
=
(
int8_t
)
tsIsCluster
;
memset
(
pConnect
->
reserved
,
0
,
sizeof
(
pConnect
->
reserved
));
pMsg
+=
sizeof
(
SConnectMsg
);
...
...
src/inc/taosmsg.h
浏览文件 @
d774aa39
...
...
@@ -224,7 +224,9 @@ typedef struct {
uint32_t
destId
;
char
meterId
[
TSDB_UNI_LEN
];
uint16_t
port
;
// for UDP only
char
empty
[
1
];
uint8_t
usePublicIp
:
1
;
uint8_t
isCluster
:
1
;
uint8_t
empty
:
6
;
uint8_t
msgType
;
int32_t
msgLen
;
uint8_t
content
[
0
];
...
...
@@ -352,9 +354,6 @@ typedef struct {
typedef
struct
{
char
clientVersion
[
TSDB_VERSION_LEN
];
char
db
[
TSDB_METER_ID_LEN
];
int8_t
usePublicIp
;
int8_t
isCluster
;
int8_t
reserved
[
14
];
}
SConnectMsg
;
typedef
struct
{
...
...
@@ -667,8 +666,11 @@ typedef struct {
typedef
struct
{
uint32_t
destId
;
char
meterId
[
TSDB_UNI_LEN
];
char
empty
[
3
];
char
msgType
;
uint16_t
port
;
// for UDP only
uint8_t
usePublicIp
:
1
;
uint8_t
isCluster
:
1
;
uint8_t
empty
:
6
;
uint8_t
msgType
;
int32_t
msgLen
;
uint8_t
content
[
0
];
}
SIntMsg
;
...
...
src/rpc/src/trpc.c
浏览文件 @
d774aa39
...
...
@@ -246,6 +246,8 @@ char *taosBuildReqHeader(void *param, char type, char *msg) {
pHeader
->
destId
=
pConn
->
peerId
;
pHeader
->
port
=
0
;
pHeader
->
uid
=
(
uint32_t
)
pConn
+
(
uint32_t
)
getpid
();
pHeader
->
usePublicIp
=
(
tsUsePublicIp
==
0
?
0
:
1
);
pHeader
->
isCluster
=
(
tsIsCluster
==
0
?
0
:
1
);
memcpy
(
pHeader
->
meterId
,
pConn
->
meterId
,
tListLen
(
pHeader
->
meterId
));
...
...
src/system/detail/inc/mgmt.h
浏览文件 @
d774aa39
...
...
@@ -223,7 +223,8 @@ typedef struct _connObj {
char
writeAuth
:
1
;
// write flag
char
killConnection
:
1
;
// kill the connection flag
char
usePublicIp
:
1
;
// if the connection request is publicIp
char
reserved
:
4
;
char
isCluster
:
1
;
char
reserved
:
3
;
uint32_t
queryId
;
// query ID to be killed
uint32_t
streamId
;
// stream ID to be killed
uint32_t
ip
;
// shell IP
...
...
src/system/detail/src/mgmtShell.c
浏览文件 @
d774aa39
...
...
@@ -1201,8 +1201,8 @@ int mgmtProcessConnectMsg(char *pMsg, int msgLen, SConnObj *pConn) {
goto
_rsp
;
}
if
(
pConn
ectMsg
->
isCluster
!=
tsIsCluster
)
{
mError
(
"Cluster Edition and lite Edition cannot be interconnected, client:%d server:%d"
,
pConn
ectMsg
->
isCluster
,
tsIsCluster
);
if
(
pConn
->
isCluster
!=
tsIsCluster
)
{
mError
(
"Cluster Edition and lite Edition cannot be interconnected, client:%d server:%d"
,
pConn
->
isCluster
,
tsIsCluster
);
code
=
TSDB_CODE_INVALID_CLIENT_VERSION
;
goto
_rsp
;
}
...
...
@@ -1246,17 +1246,13 @@ _rsp:
pMsg
+=
sizeof
(
SConnectRsp
);
#ifdef CLUSTER
if
(
pConnectMsg
->
usePublicIp
)
{
pConn
->
usePublicIp
=
1
;
int
size
=
pSdbPublicIpList
->
numOfIps
*
4
+
sizeof
(
SIpList
);
if
(
pConn
->
usePublicIp
)
{
memcpy
(
pMsg
,
pSdbPublicIpList
,
size
);
pMsg
+=
size
;
}
else
{
int
size
=
pSdbIpList
->
numOfIps
*
4
+
sizeof
(
SIpList
);
}
else
{
memcpy
(
pMsg
,
pSdbIpList
,
size
);
pMsg
+=
size
;
}
pMsg
+=
size
;
#endif
// set the time resolution: millisecond or microsecond
...
...
@@ -1305,7 +1301,15 @@ void *mgmtProcessMsgFromShell(char *msg, void *ahandle, void *thandle) {
pConn
=
connList
+
pMsg
->
destId
;
pConn
->
thandle
=
thandle
;
strcpy
(
pConn
->
user
,
pMsg
->
meterId
);
uint32_t
ip
=
taosGetRpcLocalIp
(
thandle
);
if
(
ip
==
tsPublicIp
)
{
pConn
->
usePublicIp
=
true
;
}
}
pConn
->
usePublicIp
=
pMsg
->
usePublicIp
;
pConn
->
isCluster
=
pMsg
->
isCluster
;
if
(
pMsg
->
msgType
==
TSDB_MSG_TYPE_CONNECT
)
{
(
*
mgmtProcessShellMsg
[
pMsg
->
msgType
])((
char
*
)
pMsg
->
content
,
pMsg
->
msgLen
-
sizeof
(
SIntMsg
),
pConn
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录