Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
ebb98e4e
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
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看板
未验证
提交
ebb98e4e
编写于
7月 22, 2022
作者:
Y
Yang Zhao
提交者:
GitHub
7月 22, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: do not show any ws info in websocket in not defined (#15293)
上级
5a1412f4
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
45 addition
and
4 deletion
+45
-4
src/kit/shell/inc/shell.h
src/kit/shell/inc/shell.h
+2
-2
src/kit/shell/src/shellDarwin.c
src/kit/shell/src/shellDarwin.c
+12
-1
src/kit/shell/src/shellLinux.c
src/kit/shell/src/shellLinux.c
+12
-0
src/kit/shell/src/shellMain.c
src/kit/shell/src/shellMain.c
+7
-1
src/kit/shell/src/shellWindows.c
src/kit/shell/src/shellWindows.c
+12
-0
未找到文件。
src/kit/shell/inc/shell.h
浏览文件 @
ebb98e4e
...
@@ -51,7 +51,6 @@ typedef struct SShellArguments {
...
@@ -51,7 +51,6 @@ typedef struct SShellArguments {
char
*
auth
;
char
*
auth
;
char
*
database
;
char
*
database
;
char
*
timezone
;
char
*
timezone
;
bool
restful
;
TAOS
*
con
;
TAOS
*
con
;
bool
is_raw_time
;
bool
is_raw_time
;
bool
is_use_passwd
;
bool
is_use_passwd
;
...
@@ -69,10 +68,11 @@ typedef struct SShellArguments {
...
@@ -69,10 +68,11 @@ typedef struct SShellArguments {
char
*
netTestRole
;
char
*
netTestRole
;
char
*
dsn
;
char
*
dsn
;
#ifdef WEBSOCKET
#ifdef WEBSOCKET
bool
restful
;
WS_TAOS
*
ws_conn
;
WS_TAOS
*
ws_conn
;
#endif
bool
cloud
;
bool
cloud
;
uint32_t
timeout
;
uint32_t
timeout
;
#endif
}
SShellArguments
;
}
SShellArguments
;
/**************** Function declarations ****************/
/**************** Function declarations ****************/
...
...
src/kit/shell/src/shellDarwin.c
浏览文件 @
ebb98e4e
...
@@ -60,12 +60,14 @@ void printHelp() {
...
@@ -60,12 +60,14 @@ void printHelp() {
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
"Use multi-thread to import all SQL files in the directory separately."
);
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
"Use multi-thread to import all SQL files in the directory separately."
);
printf
(
"%s%s
\n
"
,
indent
,
"-T"
);
printf
(
"%s%s
\n
"
,
indent
,
"-T"
);
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
"Number of threads when using multi-thread to import data."
);
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
"Number of threads when using multi-thread to import data."
);
#ifdef WEBSOCKET
printf
(
"%s%s
\n
"
,
indent
,
"-R"
);
printf
(
"%s%s
\n
"
,
indent
,
"-R"
);
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
"Connect and interact with TDengine use restful."
);
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
"Connect and interact with TDengine use restful."
);
printf
(
"%s%s
\n
"
,
indent
,
"-E"
);
printf
(
"%s%s
\n
"
,
indent
,
"-E"
);
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
"The DSN to use when connecting TDengine's cloud services."
);
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
"The DSN to use when connecting TDengine's cloud services."
);
printf
(
"%s%s
\n
"
,
indent
,
"-t"
);
printf
(
"%s%s
\n
"
,
indent
,
"-t"
);
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
"The timeout in seconds for websocket interact."
);
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
"The timeout in seconds for websocket interact."
);
#endif
exit
(
EXIT_SUCCESS
);
exit
(
EXIT_SUCCESS
);
}
}
...
@@ -79,7 +81,9 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
...
@@ -79,7 +81,9 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
// for host
// for host
if
(
strcmp
(
argv
[
i
],
"-h"
)
==
0
)
{
if
(
strcmp
(
argv
[
i
],
"-h"
)
==
0
)
{
if
(
i
<
argc
-
1
)
{
if
(
i
<
argc
-
1
)
{
#ifdef WEBSOCKET
arguments
->
cloud
=
false
;
arguments
->
cloud
=
false
;
#endif
arguments
->
host
=
argv
[
++
i
];
arguments
->
host
=
argv
[
++
i
];
}
else
{
}
else
{
fprintf
(
stderr
,
"option -h requires an argument
\n
"
);
fprintf
(
stderr
,
"option -h requires an argument
\n
"
);
...
@@ -111,7 +115,9 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
...
@@ -111,7 +115,9 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
// for management port
// for management port
else
if
(
strcmp
(
argv
[
i
],
"-P"
)
==
0
)
{
else
if
(
strcmp
(
argv
[
i
],
"-P"
)
==
0
)
{
if
(
i
<
argc
-
1
)
{
if
(
i
<
argc
-
1
)
{
#ifdef WEBSOCKET
arguments
->
cloud
=
false
;
arguments
->
cloud
=
false
;
#endif
arguments
->
port
=
atoi
(
argv
[
++
i
]);
arguments
->
port
=
atoi
(
argv
[
++
i
]);
}
else
{
}
else
{
fprintf
(
stderr
,
"option -P requires an argument
\n
"
);
fprintf
(
stderr
,
"option -P requires an argument
\n
"
);
...
@@ -128,7 +134,9 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
...
@@ -128,7 +134,9 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
}
}
}
else
if
(
strcmp
(
argv
[
i
],
"-c"
)
==
0
)
{
}
else
if
(
strcmp
(
argv
[
i
],
"-c"
)
==
0
)
{
if
(
i
<
argc
-
1
)
{
if
(
i
<
argc
-
1
)
{
#ifdef WEBSOCKET
arguments
->
cloud
=
false
;
arguments
->
cloud
=
false
;
#endif
if
(
strlen
(
argv
[
++
i
])
>=
TSDB_FILENAME_LEN
)
{
if
(
strlen
(
argv
[
++
i
])
>=
TSDB_FILENAME_LEN
)
{
fprintf
(
stderr
,
"config file path: %s overflow max len %d
\n
"
,
argv
[
i
],
TSDB_FILENAME_LEN
-
1
);
fprintf
(
stderr
,
"config file path: %s overflow max len %d
\n
"
,
argv
[
i
],
TSDB_FILENAME_LEN
-
1
);
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
...
@@ -198,7 +206,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
...
@@ -198,7 +206,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
}
}
#ifdef WEBSOCKET
else
if
(
strcmp
(
argv
[
i
],
"-R"
)
==
0
)
{
else
if
(
strcmp
(
argv
[
i
],
"-R"
)
==
0
)
{
arguments
->
cloud
=
false
;
arguments
->
cloud
=
false
;
arguments
->
restful
=
true
;
arguments
->
restful
=
true
;
...
@@ -221,6 +229,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
...
@@ -221,6 +229,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
}
}
#endif
// For temperory command TODO
// For temperory command TODO
else
if
(
strcmp
(
argv
[
i
],
"--help"
)
==
0
)
{
else
if
(
strcmp
(
argv
[
i
],
"--help"
)
==
0
)
{
...
@@ -232,6 +241,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
...
@@ -232,6 +241,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
}
}
#ifdef WEBSOCKET
if
(
args
.
dsn
==
NULL
)
{
if
(
args
.
dsn
==
NULL
)
{
if
(
args
.
cloud
)
{
if
(
args
.
cloud
)
{
args
.
dsn
=
getenv
(
"TDENGINE_CLOUD_DSN"
);
args
.
dsn
=
getenv
(
"TDENGINE_CLOUD_DSN"
);
...
@@ -242,6 +252,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
...
@@ -242,6 +252,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
}
else
{
}
else
{
args
.
cloud
=
true
;
args
.
cloud
=
true
;
}
}
#endif
}
}
int32_t
shellReadCommand
(
TAOS
*
con
,
char
*
command
)
{
int32_t
shellReadCommand
(
TAOS
*
con
,
char
*
command
)
{
...
...
src/kit/shell/src/shellLinux.c
浏览文件 @
ebb98e4e
...
@@ -52,9 +52,11 @@ static struct argp_option options[] = {
...
@@ -52,9 +52,11 @@ static struct argp_option options[] = {
{
"pktlen"
,
'l'
,
"PKTLEN"
,
0
,
"Packet length used for net test, default is 1000 bytes."
},
{
"pktlen"
,
'l'
,
"PKTLEN"
,
0
,
"Packet length used for net test, default is 1000 bytes."
},
{
"pktnum"
,
'N'
,
"PKTNUM"
,
0
,
"Packet numbers used for net test, default is 100."
},
{
"pktnum"
,
'N'
,
"PKTNUM"
,
0
,
"Packet numbers used for net test, default is 100."
},
{
"pkttype"
,
'S'
,
"PKTTYPE"
,
0
,
"Choose packet type used for net test, default is TCP. Only speed test could be either TCP or UDP."
},
{
"pkttype"
,
'S'
,
"PKTTYPE"
,
0
,
"Choose packet type used for net test, default is TCP. Only speed test could be either TCP or UDP."
},
#ifdef WEBSOCKET
{
"restful"
,
'R'
,
0
,
0
,
"Connect and interact with TDengine use restful."
},
{
"restful"
,
'R'
,
0
,
0
,
"Connect and interact with TDengine use restful."
},
{
"cloudDsn"
,
'E'
,
"DSN"
,
0
,
"The DSN to use when connecting TDengine's cloud services."
},
{
"cloudDsn"
,
'E'
,
"DSN"
,
0
,
"The DSN to use when connecting TDengine's cloud services."
},
{
"timeout"
,
't'
,
"SECONDS"
,
0
,
"The timeout seconds for websocket to interact."
},
{
"timeout"
,
't'
,
"SECONDS"
,
0
,
"The timeout seconds for websocket to interact."
},
#endif
{
0
}};
{
0
}};
static
error_t
parse_opt
(
int
key
,
char
*
arg
,
struct
argp_state
*
state
)
{
static
error_t
parse_opt
(
int
key
,
char
*
arg
,
struct
argp_state
*
state
)
{
...
@@ -66,7 +68,9 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
...
@@ -66,7 +68,9 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
switch
(
key
)
{
switch
(
key
)
{
case
'h'
:
case
'h'
:
if
(
arg
)
{
if
(
arg
)
{
#ifdef WEBSOCKET
args
.
cloud
=
false
;
args
.
cloud
=
false
;
#endif
args
.
host
=
arg
;
args
.
host
=
arg
;
}
else
{
}
else
{
fprintf
(
stderr
,
"Invalid host
\n
"
);
fprintf
(
stderr
,
"Invalid host
\n
"
);
...
@@ -77,7 +81,9 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
...
@@ -77,7 +81,9 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
break
;
break
;
case
'P'
:
case
'P'
:
if
(
arg
)
{
if
(
arg
)
{
#ifdef WEBSOCKET
args
.
cloud
=
false
;
args
.
cloud
=
false
;
#endif
tsDnodeShellPort
=
atoi
(
arg
);
tsDnodeShellPort
=
atoi
(
arg
);
args
.
port
=
atoi
(
arg
);
args
.
port
=
atoi
(
arg
);
}
else
{
}
else
{
...
@@ -105,7 +111,9 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
...
@@ -105,7 +111,9 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
wordfree
(
&
full_path
);
wordfree
(
&
full_path
);
return
-
1
;
return
-
1
;
}
}
#ifdef WEBSOCKET
args
.
cloud
=
false
;
args
.
cloud
=
false
;
#endif
tstrncpy
(
configDir
,
full_path
.
we_wordv
[
0
],
TSDB_FILENAME_LEN
);
tstrncpy
(
configDir
,
full_path
.
we_wordv
[
0
],
TSDB_FILENAME_LEN
);
wordfree
(
&
full_path
);
wordfree
(
&
full_path
);
break
;
break
;
...
@@ -173,6 +181,7 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
...
@@ -173,6 +181,7 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
case
OPT_ABORT
:
case
OPT_ABORT
:
arguments
->
abort
=
1
;
arguments
->
abort
=
1
;
break
;
break
;
#ifdef WEBSOCKET
case
'R'
:
case
'R'
:
arguments
->
restful
=
true
;
arguments
->
restful
=
true
;
arguments
->
cloud
=
false
;
arguments
->
cloud
=
false
;
...
@@ -192,6 +201,7 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
...
@@ -192,6 +201,7 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
fprintf
(
stderr
,
"Invalid -t option
\n
"
);
fprintf
(
stderr
,
"Invalid -t option
\n
"
);
}
}
break
;
break
;
#endif
default:
default:
return
ARGP_ERR_UNKNOWN
;
return
ARGP_ERR_UNKNOWN
;
}
}
...
@@ -245,6 +255,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
...
@@ -245,6 +255,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
argp_parse
(
&
argp
,
argc
,
argv
,
0
,
0
,
arguments
);
argp_parse
(
&
argp
,
argc
,
argv
,
0
,
0
,
arguments
);
#ifdef WEBSOCKET
if
(
args
.
dsn
==
NULL
)
{
if
(
args
.
dsn
==
NULL
)
{
if
(
args
.
cloud
)
{
if
(
args
.
cloud
)
{
args
.
dsn
=
getenv
(
"TDENGINE_CLOUD_DSN"
);
args
.
dsn
=
getenv
(
"TDENGINE_CLOUD_DSN"
);
...
@@ -255,6 +266,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
...
@@ -255,6 +266,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
}
else
{
}
else
{
args
.
cloud
=
true
;
args
.
cloud
=
true
;
}
}
#endif
if
(
arguments
->
abort
)
{
if
(
arguments
->
abort
)
{
#ifndef _ALPINE
#ifndef _ALPINE
...
...
src/kit/shell/src/shellMain.c
浏览文件 @
ebb98e4e
...
@@ -37,9 +37,11 @@ void *cancelHandler(void *arg) {
...
@@ -37,9 +37,11 @@ void *cancelHandler(void *arg) {
taosMsleep
(
10
);
taosMsleep
(
10
);
continue
;
continue
;
}
}
#ifdef WEBSOCKET
if
(
args
.
restful
||
args
.
cloud
)
{
if
(
args
.
restful
||
args
.
cloud
)
{
stop_fetch
=
true
;
stop_fetch
=
true
;
}
}
#endif
#ifdef LINUX
#ifdef LINUX
int64_t
rid
=
atomic_val_compare_exchange_64
(
&
result
,
result
,
0
);
int64_t
rid
=
atomic_val_compare_exchange_64
(
&
result
,
result
,
0
);
SSqlObj
*
pSql
=
taosAcquireRef
(
tscObjRef
,
rid
);
SSqlObj
*
pSql
=
taosAcquireRef
(
tscObjRef
,
rid
);
...
@@ -81,7 +83,6 @@ SShellArguments args = {.host = NULL,
...
@@ -81,7 +83,6 @@ SShellArguments args = {.host = NULL,
.
user
=
NULL
,
.
user
=
NULL
,
.
database
=
NULL
,
.
database
=
NULL
,
.
timezone
=
NULL
,
.
timezone
=
NULL
,
.
restful
=
false
,
.
is_raw_time
=
false
,
.
is_raw_time
=
false
,
.
is_use_passwd
=
false
,
.
is_use_passwd
=
false
,
.
dump_config
=
false
,
.
dump_config
=
false
,
...
@@ -93,9 +94,12 @@ SShellArguments args = {.host = NULL,
...
@@ -93,9 +94,12 @@ SShellArguments args = {.host = NULL,
.
pktNum
=
100
,
.
pktNum
=
100
,
.
pktType
=
"TCP"
,
.
pktType
=
"TCP"
,
.
netTestRole
=
NULL
,
.
netTestRole
=
NULL
,
#ifdef WEBSOCKET
.
restful
=
false
,
.
cloud
=
true
,
.
cloud
=
true
,
.
dsn
=
NULL
,
.
dsn
=
NULL
,
.
timeout
=
10
,
.
timeout
=
10
,
#endif
};
};
/*
/*
...
@@ -135,6 +139,7 @@ int main(int argc, char* argv[]) {
...
@@ -135,6 +139,7 @@ int main(int argc, char* argv[]) {
exit
(
0
);
exit
(
0
);
}
}
#ifdef WEBSOCKET
if
(
args
.
restful
)
{
if
(
args
.
restful
)
{
args
.
dsn
=
calloc
(
1
,
1024
);
args
.
dsn
=
calloc
(
1
,
1024
);
...
@@ -148,6 +153,7 @@ int main(int argc, char* argv[]) {
...
@@ -148,6 +153,7 @@ int main(int argc, char* argv[]) {
snprintf
(
args
.
dsn
,
1024
,
"ws://%s:%d/rest/ws"
,
args
.
host
,
args
.
port
);
snprintf
(
args
.
dsn
,
1024
,
"ws://%s:%d/rest/ws"
,
args
.
host
,
args
.
port
);
}
}
#endif
/* Initialize the shell */
/* Initialize the shell */
shellInit
(
&
args
);
shellInit
(
&
args
);
...
...
src/kit/shell/src/shellWindows.c
浏览文件 @
ebb98e4e
...
@@ -62,12 +62,14 @@ void printHelp() {
...
@@ -62,12 +62,14 @@ void printHelp() {
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
"Packet length used for net test, default is 1000 bytes."
);
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
"Packet length used for net test, default is 1000 bytes."
);
printf
(
"%s%s
\n
"
,
indent
,
"-N"
);
printf
(
"%s%s
\n
"
,
indent
,
"-N"
);
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
"Packet numbers used for net test, default is 100."
);
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
"Packet numbers used for net test, default is 100."
);
#ifdef WEBSOCKET
printf
(
"%s%s
\n
"
,
indent
,
"-R"
);
printf
(
"%s%s
\n
"
,
indent
,
"-R"
);
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
"Connect and interact with TDengine use restful."
);
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
"Connect and interact with TDengine use restful."
);
printf
(
"%s%s
\n
"
,
indent
,
"-E"
);
printf
(
"%s%s
\n
"
,
indent
,
"-E"
);
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
"The DSN to use when connecting TDengine's cloud services."
);
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
"The DSN to use when connecting TDengine's cloud services."
);
printf
(
"%s%s
\n
"
,
indent
,
"-t"
);
printf
(
"%s%s
\n
"
,
indent
,
"-t"
);
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
"The timeout seconds for websocekt to interact."
);
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
"The timeout seconds for websocekt to interact."
);
#endif
printf
(
"%s%s
\n
"
,
indent
,
"-S"
);
printf
(
"%s%s
\n
"
,
indent
,
"-S"
);
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
"Packet type used for net test, default is TCP."
);
printf
(
"%s%s%s
\n
"
,
indent
,
indent
,
"Packet type used for net test, default is TCP."
);
printf
(
"%s%s
\n
"
,
indent
,
"-V"
);
printf
(
"%s%s
\n
"
,
indent
,
"-V"
);
...
@@ -82,7 +84,9 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
...
@@ -82,7 +84,9 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
// for host
// for host
if
(
strcmp
(
argv
[
i
],
"-h"
)
==
0
)
{
if
(
strcmp
(
argv
[
i
],
"-h"
)
==
0
)
{
if
(
i
<
argc
-
1
)
{
if
(
i
<
argc
-
1
)
{
#ifdef WEBSOCKET
arguments
->
cloud
=
false
;
arguments
->
cloud
=
false
;
#endif
arguments
->
host
=
argv
[
++
i
];
arguments
->
host
=
argv
[
++
i
];
}
else
{
}
else
{
fprintf
(
stderr
,
"option -h requires an argument
\n
"
);
fprintf
(
stderr
,
"option -h requires an argument
\n
"
);
...
@@ -114,7 +118,9 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
...
@@ -114,7 +118,9 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
// for management port
// for management port
else
if
(
strcmp
(
argv
[
i
],
"-P"
)
==
0
)
{
else
if
(
strcmp
(
argv
[
i
],
"-P"
)
==
0
)
{
if
(
i
<
argc
-
1
)
{
if
(
i
<
argc
-
1
)
{
#ifdef WEBSOCKET
arguments
->
cloud
=
false
;
arguments
->
cloud
=
false
;
#endif
arguments
->
port
=
atoi
(
argv
[
++
i
]);
arguments
->
port
=
atoi
(
argv
[
++
i
]);
}
else
{
}
else
{
fprintf
(
stderr
,
"option -P requires an argument
\n
"
);
fprintf
(
stderr
,
"option -P requires an argument
\n
"
);
...
@@ -138,7 +144,9 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
...
@@ -138,7 +144,9 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
}
}
}
else
if
(
strcmp
(
argv
[
i
],
"-c"
)
==
0
)
{
}
else
if
(
strcmp
(
argv
[
i
],
"-c"
)
==
0
)
{
if
(
i
<
argc
-
1
)
{
if
(
i
<
argc
-
1
)
{
#ifdef WEBSOCKET
arguments
->
cloud
=
false
;
arguments
->
cloud
=
false
;
#endif
char
*
tmp
=
argv
[
++
i
];
char
*
tmp
=
argv
[
++
i
];
if
(
strlen
(
tmp
)
>=
TSDB_FILENAME_LEN
)
{
if
(
strlen
(
tmp
)
>=
TSDB_FILENAME_LEN
)
{
fprintf
(
stderr
,
"config file path: %s overflow max len %d
\n
"
,
tmp
,
TSDB_FILENAME_LEN
-
1
);
fprintf
(
stderr
,
"config file path: %s overflow max len %d
\n
"
,
tmp
,
TSDB_FILENAME_LEN
-
1
);
...
@@ -220,6 +228,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
...
@@ -220,6 +228,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
}
}
#ifdef WEBSOCKET
else
if
(
strcmp
(
argv
[
i
],
"-R"
)
==
0
)
{
else
if
(
strcmp
(
argv
[
i
],
"-R"
)
==
0
)
{
arguments
->
cloud
=
false
;
arguments
->
cloud
=
false
;
...
@@ -243,6 +252,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
...
@@ -243,6 +252,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
}
}
#endif
else
if
(
strcmp
(
argv
[
i
],
"-V"
)
==
0
)
{
else
if
(
strcmp
(
argv
[
i
],
"-V"
)
==
0
)
{
printVersion
();
printVersion
();
...
@@ -258,6 +268,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
...
@@ -258,6 +268,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
}
}
#ifdef WEBSOCKET
if
(
args
.
dsn
==
NULL
)
{
if
(
args
.
dsn
==
NULL
)
{
if
(
args
.
cloud
)
{
if
(
args
.
cloud
)
{
args
.
dsn
=
getenv
(
"TDENGINE_CLOUD_DSN"
);
args
.
dsn
=
getenv
(
"TDENGINE_CLOUD_DSN"
);
...
@@ -274,6 +285,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
...
@@ -274,6 +285,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
}
else
{
}
else
{
args
.
cloud
=
true
;
args
.
cloud
=
true
;
}
}
#endif
}
}
void
shellPrintContinuePrompt
()
{
printf
(
"%s"
,
CONTINUE_PROMPT
);
}
void
shellPrintContinuePrompt
()
{
printf
(
"%s"
,
CONTINUE_PROMPT
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录