Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
251fdf2c
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
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看板
提交
251fdf2c
编写于
9月 27, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-1617 defect found by coverity scan
上级
d08432ea
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
21 addition
and
15 deletion
+21
-15
src/dnode/src/dnodeModule.c
src/dnode/src/dnodeModule.c
+2
-2
src/mnode/src/mnodeTable.c
src/mnode/src/mnodeTable.c
+2
-2
src/os/src/detail/osDir.c
src/os/src/detail/osDir.c
+2
-1
src/plugins/http/src/httpParser.c
src/plugins/http/src/httpParser.c
+15
-10
未找到文件。
src/dnode/src/dnodeModule.c
浏览文件 @
251fdf2c
...
...
@@ -147,13 +147,13 @@ void dnodeProcessModuleStatus(uint32_t moduleStatus) {
}
bool
dnodeCheckMnodeStarting
()
{
if
(
tsModuleStatus
&
TSDB_MOD_MNODE
)
return
false
;
if
(
tsModuleStatus
&
(
1
<<
TSDB_MOD_MNODE
)
)
return
false
;
SDMMnodeInfos
*
mnodes
=
dnodeGetMnodeInfos
();
for
(
int32_t
i
=
0
;
i
<
mnodes
->
nodeNum
;
++
i
)
{
SDMMnodeInfo
*
node
=
&
mnodes
->
nodeInfos
[
i
];
if
(
node
->
nodeId
==
dnodeGetDnodeId
())
{
uint32_t
moduleStatus
=
tsModuleStatus
|
(
1
<<
TSDB_MOD_MNODE
);
;
uint32_t
moduleStatus
=
tsModuleStatus
|
(
1
<<
TSDB_MOD_MNODE
);
dInfo
(
"start mnode module, module status:%d, new status:%d"
,
tsModuleStatus
,
moduleStatus
);
dnodeProcessModuleStatus
(
moduleStatus
);
return
true
;
...
...
src/mnode/src/mnodeTable.c
浏览文件 @
251fdf2c
...
...
@@ -2093,11 +2093,11 @@ static int32_t mnodeDoGetChildTableMeta(SMnodeMsg *pMsg, STableMetaMsg *pMeta) {
pMeta
->
precision
=
pDb
->
cfg
.
precision
;
pMeta
->
tableType
=
pTable
->
info
.
type
;
tstrncpy
(
pMeta
->
tableId
,
pTable
->
info
.
tableId
,
TSDB_TABLE_FNAME_LEN
);
if
(
pTable
->
superTable
)
{
if
(
pTable
->
superTable
!=
NULL
)
{
tstrncpy
(
pMeta
->
sTableId
,
pTable
->
superTable
->
info
.
tableId
,
TSDB_TABLE_FNAME_LEN
);
}
if
(
pTable
->
info
.
type
==
TSDB_CHILD_TABLE
)
{
if
(
pTable
->
info
.
type
==
TSDB_CHILD_TABLE
&&
pTable
->
superTable
!=
NULL
)
{
pMeta
->
sversion
=
htons
(
pTable
->
superTable
->
sversion
);
pMeta
->
tversion
=
htons
(
pTable
->
superTable
->
tversion
);
pMeta
->
numOfTags
=
(
int8_t
)
pTable
->
superTable
->
numOfTags
;
...
...
src/os/src/detail/osDir.c
浏览文件 @
251fdf2c
...
...
@@ -126,12 +126,13 @@ int32_t taosCompressFile(char *srcFileName, char *destFileName) {
dstFp
=
gzdopen
(
fd
,
"wb6f"
);
if
(
dstFp
==
NULL
)
{
ret
=
-
3
;
close
(
fd
);
goto
cmp_end
;
}
while
(
!
feof
(
srcFp
))
{
len
=
(
int32_t
)
fread
(
data
,
1
,
COMPRESS_STEP_SIZE
,
srcFp
);
gzwrite
(
dstFp
,
data
,
len
);
(
void
)
gzwrite
(
dstFp
,
data
,
len
);
}
cmp_end:
...
...
src/plugins/http/src/httpParser.c
浏览文件 @
251fdf2c
...
...
@@ -153,10 +153,10 @@ static int32_t httpOnRequestLine(HttpParser *pParser, char *method, char *target
for
(
int32_t
i
=
0
;
i
<
HTTP_MAX_URL
;
i
++
)
{
char
*
pSeek
=
strchr
(
pStart
,
'/'
);
if
(
pSeek
==
NULL
)
{
httpAppendString
(
pParser
->
path
+
i
,
pStart
,
strlen
(
pStart
));
(
void
)
httpAppendString
(
pParser
->
path
+
i
,
pStart
,
strlen
(
pStart
));
break
;
}
else
{
httpAppendString
(
pParser
->
path
+
i
,
pStart
,
(
int32_t
)(
pSeek
-
pStart
));
(
void
)
httpAppendString
(
pParser
->
path
+
i
,
pStart
,
(
int32_t
)(
pSeek
-
pStart
));
}
pStart
=
pSeek
+
1
;
}
...
...
@@ -485,11 +485,11 @@ void httpClearParser(HttpParser *parser) {
}
void
httpDestroyParser
(
HttpParser
*
parser
)
{
if
(
!
parser
)
return
;
HttpContext
*
pContext
=
parser
->
pContext
;
httpTrace
(
"context:%p, fd:%d, destroy parser"
,
pContext
,
pContext
->
fd
);
if
(
!
parser
)
return
;
free
(
parser
->
method
);
parser
->
method
=
NULL
;
free
(
parser
->
target
);
parser
->
target
=
NULL
;
free
(
parser
->
version
);
parser
->
version
=
NULL
;
...
...
@@ -684,23 +684,28 @@ static int32_t httpParserOnVersion(HttpParser *parser, HTTP_PARSER_STATE state,
break
;
}
if
(
c
!=
'0'
&&
c
!=
'1
'
)
{
if
(
c
!=
'0'
&&
c
!=
'1'
&&
c
!=
'2
'
)
{
httpError
(
"context:%p, fd:%d, parser state:%d, unexpected char:[%c]%02x"
,
pContext
,
pContext
->
fd
,
state
,
c
,
c
);
ok
=
-
1
;
httpOnError
(
parser
,
400
,
TSDB_CODE_HTTP_PARSE_VERSION_FAILED
);
break
;
}
if
(
httpAppendString
(
&
parser
->
str
,
&
c
,
1
))
{
httpError
(
"context:%p, fd:%d, parser state:%d, char:[%c]%02x, oom"
,
pContext
,
pContext
->
fd
,
state
,
c
,
c
);
ok
=
-
1
;
httpOnError
(
parser
,
507
,
TSDB_CODE_HTTP_PARSE_VERSION_FAILED
);
break
;
}
if
(
c
==
'0'
)
parser
->
httpVersion
=
HTTP_VERSION_10
;
else
if
(
c
==
'1'
)
parser
->
httpVersion
=
HTTP_VERSION_11
;
else
if
(
c
==
'2'
)
parser
->
httpVersion
=
HTTP_VERSION_12
;
else
parser
->
httpVersion
=
HTTP_INVALID_VERSION
;
if
(
c
==
'0'
)
parser
->
httpVersion
=
HTTP_VERSION_10
;
else
if
(
c
==
'1'
)
parser
->
httpVersion
=
HTTP_VERSION_11
;
else
if
(
c
==
'2'
)
parser
->
httpVersion
=
HTTP_VERSION_12
;
else
{
}
parser
->
version
=
strdup
(
parser
->
str
.
str
);
if
(
!
parser
->
version
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录