Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Tonvia
TDengine
提交
0101bc6e
T
TDengine
项目概览
Tonvia
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
0101bc6e
编写于
6月 19, 2020
作者:
S
Shengliang Guan
提交者:
GitHub
6月 19, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2355 from taosdata/hotfix/crash
[TD-543] fix coverity scans
上级
fd54b879
1b9ea9d0
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
19 addition
and
19 deletion
+19
-19
src/plugins/http/src/gcHandle.c
src/plugins/http/src/gcHandle.c
+2
-2
src/plugins/http/src/httpAuth.c
src/plugins/http/src/httpAuth.c
+1
-0
src/plugins/http/src/httpJson.c
src/plugins/http/src/httpJson.c
+7
-8
src/plugins/http/src/httpUtil.c
src/plugins/http/src/httpUtil.c
+1
-2
src/plugins/http/src/restHandle.c
src/plugins/http/src/restHandle.c
+2
-2
src/plugins/http/src/tgHandle.c
src/plugins/http/src/tgHandle.c
+4
-3
src/plugins/monitor/src/monitorMain.c
src/plugins/monitor/src/monitorMain.c
+1
-1
src/plugins/mqtt/src/mqttSystem.c
src/plugins/mqtt/src/mqttSystem.c
+1
-1
未找到文件。
src/plugins/http/src/gcHandle.c
浏览文件 @
0101bc6e
...
...
@@ -52,7 +52,7 @@ bool gcGetUserFromUrl(HttpContext* pContext) {
return
false
;
}
strcpy
(
pContext
->
user
,
pParser
->
path
[
GC_USER_URL_POS
].
pos
);
tstrncpy
(
pContext
->
user
,
pParser
->
path
[
GC_USER_URL_POS
].
pos
,
TSDB_USER_LEN
);
return
true
;
}
...
...
@@ -62,7 +62,7 @@ bool gcGetPassFromUrl(HttpContext* pContext) {
return
false
;
}
strcpy
(
pContext
->
pass
,
pParser
->
path
[
GC_PASS_URL_POS
].
pos
);
tstrncpy
(
pContext
->
pass
,
pParser
->
path
[
GC_PASS_URL_POS
].
pos
,
TSDB_PASSWORD_LEN
);
return
true
;
}
...
...
src/plugins/http/src/httpAuth.c
浏览文件 @
0101bc6e
...
...
@@ -29,6 +29,7 @@ bool httpParseBasicAuthToken(HttpContext *pContext, char *token, int len) {
char
*
base64
=
(
char
*
)
base64_decode
(
token
,
len
,
&
outlen
);
if
(
base64
==
NULL
||
outlen
==
0
)
{
httpError
(
"context:%p, fd:%d, ip:%s, basic token:%s parsed error"
,
pContext
,
pContext
->
fd
,
pContext
->
ipstr
,
token
);
free
(
base64
);
return
false
;
}
...
...
src/plugins/http/src/httpJson.c
浏览文件 @
0101bc6e
...
...
@@ -442,14 +442,13 @@ void httpJsonPairStatus(JsonBuf* buf, int code) {
httpJsonPair
(
buf
,
"status"
,
6
,
"error"
,
5
);
httpJsonItemToken
(
buf
);
httpJsonPairIntVal
(
buf
,
"code"
,
4
,
code
);
if
(
code
>=
0
)
{
httpJsonItemToken
(
buf
);
if
(
code
==
TSDB_CODE_MND_DB_NOT_SELECTED
)
{
httpJsonPair
(
buf
,
"desc"
,
4
,
"failed to create database"
,
23
);
}
else
if
(
code
==
TSDB_CODE_MND_INVALID_TABLE_NAME
)
{
httpJsonPair
(
buf
,
"desc"
,
4
,
"failed to create table"
,
22
);
}
else
httpJsonPair
(
buf
,
"desc"
,
4
,
(
char
*
)
tstrerror
(
code
),
(
int
)
strlen
(
tstrerror
(
code
)));
httpJsonItemToken
(
buf
);
if
(
code
==
TSDB_CODE_MND_DB_NOT_SELECTED
)
{
httpJsonPair
(
buf
,
"desc"
,
4
,
"failed to create database"
,
23
);
}
else
if
(
code
==
TSDB_CODE_MND_INVALID_TABLE_NAME
)
{
httpJsonPair
(
buf
,
"desc"
,
4
,
"failed to create table"
,
22
);
}
else
{
httpJsonPair
(
buf
,
"desc"
,
4
,
(
char
*
)
tstrerror
(
code
),
(
int
)
strlen
(
tstrerror
(
code
)));
}
}
}
src/plugins/http/src/httpUtil.c
浏览文件 @
0101bc6e
...
...
@@ -202,8 +202,7 @@ bool httpReMallocMultiCmdsSize(HttpContext *pContext, int cmdSize) {
pContext
->
user
,
cmdSize
);
return
false
;
}
memset
(
multiCmds
->
cmds
+
multiCmds
->
maxSize
*
(
int16_t
)
sizeof
(
HttpSqlCmd
),
0
,
(
size_t
)(
cmdSize
-
multiCmds
->
maxSize
)
*
sizeof
(
HttpSqlCmd
));
memset
(
multiCmds
->
cmds
+
multiCmds
->
maxSize
,
0
,
(
size_t
)(
cmdSize
-
multiCmds
->
maxSize
)
*
sizeof
(
HttpSqlCmd
));
multiCmds
->
maxSize
=
(
int16_t
)
cmdSize
;
return
true
;
...
...
src/plugins/http/src/restHandle.c
浏览文件 @
0101bc6e
...
...
@@ -65,7 +65,7 @@ bool restGetUserFromUrl(HttpContext* pContext) {
return
false
;
}
strcpy
(
pContext
->
user
,
pParser
->
path
[
REST_USER_URL_POS
].
pos
);
tstrncpy
(
pContext
->
user
,
pParser
->
path
[
REST_USER_URL_POS
].
pos
,
TSDB_USER_LEN
);
return
true
;
}
...
...
@@ -75,7 +75,7 @@ bool restGetPassFromUrl(HttpContext* pContext) {
return
false
;
}
strcpy
(
pContext
->
pass
,
pParser
->
path
[
REST_PASS_URL_POS
].
pos
);
tstrncpy
(
pContext
->
pass
,
pParser
->
path
[
REST_PASS_URL_POS
].
pos
,
TSDB_PASSWORD_LEN
);
return
true
;
}
...
...
src/plugins/http/src/tgHandle.c
浏览文件 @
0101bc6e
...
...
@@ -268,10 +268,10 @@ int tgReadSchema(char *fileName) {
httpPrint
(
"open telegraf schema file:%s success"
,
fileName
);
fseek
(
fp
,
0
,
SEEK_END
);
size_t
contentSize
=
(
size
_t
)
ftell
(
fp
);
int32_t
contentSize
=
(
int32
_t
)
ftell
(
fp
);
rewind
(
fp
);
char
*
content
=
(
char
*
)
calloc
(
contentSize
*
sizeof
(
char
)
+
1
,
1
);
size
_t
result
=
fread
(
content
,
1
,
contentSize
,
fp
);
char
*
content
=
(
char
*
)
calloc
(
contentSize
+
1
,
1
);
int32
_t
result
=
fread
(
content
,
1
,
contentSize
,
fp
);
if
(
result
!=
contentSize
)
{
httpError
(
"failed to read telegraf schema file:%s"
,
fileName
);
fclose
(
fp
);
...
...
@@ -279,6 +279,7 @@ int tgReadSchema(char *fileName) {
return
-
1
;
}
content
[
contentSize
]
=
0
;
int
schemaNum
=
tgParseSchema
(
content
,
fileName
);
free
(
content
);
...
...
src/plugins/monitor/src/monitorMain.c
浏览文件 @
0101bc6e
...
...
@@ -61,7 +61,7 @@ typedef struct {
char
ep
[
TSDB_EP_LEN
];
int8_t
cmdIndex
;
int8_t
state
;
char
sql
[
SQL_LENGTH
];
char
sql
[
SQL_LENGTH
+
1
];
void
*
initTimer
;
void
*
diskTimer
;
}
SMonitorConn
;
...
...
src/plugins/mqtt/src/mqttSystem.c
浏览文件 @
0101bc6e
...
...
@@ -164,7 +164,7 @@ void mqtt_PublishCallback(void** unused, struct mqtt_response_publish* published
void
*
mqttClientRefresher
(
void
*
client
)
{
while
(
mttIsRuning
)
{
mqtt_sync
((
struct
mqtt_client
*
)
client
);
usleep
(
100000U
);
taosMsleep
(
100
);
}
mqttPrint
(
"Exit mqttClientRefresher"
);
return
NULL
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录