Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
98286acc
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看板
提交
98286acc
编写于
4月 15, 2020
作者:
S
slguan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix possible memory lost
上级
fa463c65
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
13 addition
and
10 deletion
+13
-10
src/dnode/src/dnodeMClient.c
src/dnode/src/dnodeMClient.c
+1
-1
src/dnode/src/dnodeMain.c
src/dnode/src/dnodeMain.c
+0
-1
src/mnode/src/mgmtSdb.c
src/mnode/src/mgmtSdb.c
+2
-1
src/plugins/http/src/httpServer.c
src/plugins/http/src/httpServer.c
+8
-5
src/plugins/http/src/httpSystem.c
src/plugins/http/src/httpSystem.c
+2
-2
未找到文件。
src/dnode/src/dnodeMClient.c
浏览文件 @
98286acc
src/dnode/src/dnodeMain.c
浏览文件 @
98286acc
...
@@ -177,7 +177,6 @@ static int32_t dnodeInitSystem() {
...
@@ -177,7 +177,6 @@ static int32_t dnodeInitSystem() {
static
void
dnodeCleanUpSystem
()
{
static
void
dnodeCleanUpSystem
()
{
if
(
dnodeGetRunStatus
()
!=
TSDB_DNODE_RUN_STATUS_STOPPED
)
{
if
(
dnodeGetRunStatus
()
!=
TSDB_DNODE_RUN_STATUS_STOPPED
)
{
tclearModuleStatus
(
TSDB_MOD_MGMT
);
dnodeSetRunStatus
(
TSDB_DNODE_RUN_STATUS_STOPPED
);
dnodeSetRunStatus
(
TSDB_DNODE_RUN_STATUS_STOPPED
);
dnodeCleanupShell
();
dnodeCleanupShell
();
dnodeCleanupMnode
();
dnodeCleanupMnode
();
...
...
src/mnode/src/mgmtSdb.c
浏览文件 @
98286acc
...
@@ -504,6 +504,7 @@ void *sdbFetchRow(void *handle, void *pNode, void **ppRow) {
...
@@ -504,6 +504,7 @@ void *sdbFetchRow(void *handle, void *pNode, void **ppRow) {
void
*
sdbOpenTable
(
SSdbTableDesc
*
pDesc
)
{
void
*
sdbOpenTable
(
SSdbTableDesc
*
pDesc
)
{
SSdbTable
*
pTable
=
(
SSdbTable
*
)
calloc
(
1
,
sizeof
(
SSdbTable
));
SSdbTable
*
pTable
=
(
SSdbTable
*
)
calloc
(
1
,
sizeof
(
SSdbTable
));
if
(
pTable
==
NULL
)
return
NULL
;
if
(
pTable
==
NULL
)
return
NULL
;
strcpy
(
pTable
->
tableName
,
pDesc
->
tableName
);
strcpy
(
pTable
->
tableName
,
pDesc
->
tableName
);
...
...
src/plugins/http/src/httpServer.c
浏览文件 @
98286acc
...
@@ -270,7 +270,7 @@ void httpCleanUpConnect(HttpServer *pServer) {
...
@@ -270,7 +270,7 @@ void httpCleanUpConnect(HttpServer *pServer) {
for
(
i
=
0
;
i
<
pServer
->
numOfThreads
;
++
i
)
{
for
(
i
=
0
;
i
<
pServer
->
numOfThreads
;
++
i
)
{
pThread
=
pServer
->
pThreads
+
i
;
pThread
=
pServer
->
pThreads
+
i
;
taosCloseSocket
(
pThread
->
pollFd
);
//
taosCloseSocket(pThread->pollFd);
while
(
pThread
->
pHead
)
{
while
(
pThread
->
pHead
)
{
httpCleanUpContext
(
pThread
->
pHead
,
0
);
httpCleanUpContext
(
pThread
->
pHead
,
0
);
...
@@ -591,7 +591,6 @@ void httpAcceptHttpConnection(void *arg) {
...
@@ -591,7 +591,6 @@ void httpAcceptHttpConnection(void *arg) {
bool
httpInitConnect
(
HttpServer
*
pServer
)
{
bool
httpInitConnect
(
HttpServer
*
pServer
)
{
int
i
;
int
i
;
pthread_attr_t
thattr
;
HttpThread
*
pThread
;
HttpThread
*
pThread
;
pServer
->
pThreads
=
(
HttpThread
*
)
malloc
(
sizeof
(
HttpThread
)
*
(
size_t
)
pServer
->
numOfThreads
);
pServer
->
pThreads
=
(
HttpThread
*
)
malloc
(
sizeof
(
HttpThread
)
*
(
size_t
)
pServer
->
numOfThreads
);
...
@@ -601,8 +600,6 @@ bool httpInitConnect(HttpServer *pServer) {
...
@@ -601,8 +600,6 @@ bool httpInitConnect(HttpServer *pServer) {
}
}
memset
(
pServer
->
pThreads
,
0
,
sizeof
(
HttpThread
)
*
(
size_t
)
pServer
->
numOfThreads
);
memset
(
pServer
->
pThreads
,
0
,
sizeof
(
HttpThread
)
*
(
size_t
)
pServer
->
numOfThreads
);
pthread_attr_init
(
&
thattr
);
pthread_attr_setdetachstate
(
&
thattr
,
PTHREAD_CREATE_JOINABLE
);
pThread
=
pServer
->
pThreads
;
pThread
=
pServer
->
pThreads
;
for
(
i
=
0
;
i
<
pServer
->
numOfThreads
;
++
i
)
{
for
(
i
=
0
;
i
<
pServer
->
numOfThreads
;
++
i
)
{
sprintf
(
pThread
->
label
,
"%s%d"
,
pServer
->
label
,
i
);
sprintf
(
pThread
->
label
,
"%s%d"
,
pServer
->
label
,
i
);
...
@@ -626,21 +623,27 @@ bool httpInitConnect(HttpServer *pServer) {
...
@@ -626,21 +623,27 @@ bool httpInitConnect(HttpServer *pServer) {
return
false
;
return
false
;
}
}
pthread_attr_t
thattr
;
pthread_attr_init
(
&
thattr
);
pthread_attr_setdetachstate
(
&
thattr
,
PTHREAD_CREATE_JOINABLE
);
if
(
pthread_create
(
&
(
pThread
->
thread
),
&
thattr
,
(
void
*
)
httpProcessHttpData
,
(
void
*
)(
pThread
))
!=
0
)
{
if
(
pthread_create
(
&
(
pThread
->
thread
),
&
thattr
,
(
void
*
)
httpProcessHttpData
,
(
void
*
)(
pThread
))
!=
0
)
{
httpError
(
"http thread:%s, failed to create HTTP process data thread, reason:%s"
,
httpError
(
"http thread:%s, failed to create HTTP process data thread, reason:%s"
,
pThread
->
label
,
strerror
(
errno
));
pThread
->
label
,
strerror
(
errno
));
return
false
;
return
false
;
}
}
pthread_attr_destroy
(
&
thattr
);
httpTrace
(
"http thread:%p:%s, initialized"
,
pThread
,
pThread
->
label
);
httpTrace
(
"http thread:%p:%s, initialized"
,
pThread
,
pThread
->
label
);
pThread
++
;
pThread
++
;
}
}
pthread_attr_t
thattr
;
pthread_attr_init
(
&
thattr
);
pthread_attr_setdetachstate
(
&
thattr
,
PTHREAD_CREATE_JOINABLE
);
if
(
pthread_create
(
&
(
pServer
->
thread
),
&
thattr
,
(
void
*
)
httpAcceptHttpConnection
,
(
void
*
)(
pServer
))
!=
0
)
{
if
(
pthread_create
(
&
(
pServer
->
thread
),
&
thattr
,
(
void
*
)
httpAcceptHttpConnection
,
(
void
*
)(
pServer
))
!=
0
)
{
httpError
(
"http server:%s, failed to create Http accept thread, reason:%s"
,
pServer
->
label
,
strerror
(
errno
));
httpError
(
"http server:%s, failed to create Http accept thread, reason:%s"
,
pServer
->
label
,
strerror
(
errno
));
return
false
;
return
false
;
}
}
pthread_attr_destroy
(
&
thattr
);
pthread_attr_destroy
(
&
thattr
);
httpTrace
(
"http server:%s, initialized, ip:%s:%u, numOfThreads:%d"
,
pServer
->
label
,
pServer
->
serverIp
,
httpTrace
(
"http server:%s, initialized, ip:%s:%u, numOfThreads:%d"
,
pServer
->
label
,
pServer
->
serverIp
,
...
...
src/plugins/http/src/httpSystem.c
浏览文件 @
98286acc
...
@@ -54,7 +54,7 @@ static HttpServer *httpServer = NULL;
...
@@ -54,7 +54,7 @@ static HttpServer *httpServer = NULL;
void
taosInitNote
(
int
numOfNoteLines
,
int
maxNotes
,
char
*
lable
);
void
taosInitNote
(
int
numOfNoteLines
,
int
maxNotes
,
char
*
lable
);
int
httpInitSystem
()
{
int
httpInitSystem
()
{
taos_init
();
//
taos_init();
httpServer
=
(
HttpServer
*
)
malloc
(
sizeof
(
HttpServer
));
httpServer
=
(
HttpServer
*
)
malloc
(
sizeof
(
HttpServer
));
memset
(
httpServer
,
0
,
sizeof
(
HttpServer
));
memset
(
httpServer
,
0
,
sizeof
(
HttpServer
));
...
@@ -129,7 +129,7 @@ void httpCleanUpSystem() {
...
@@ -129,7 +129,7 @@ void httpCleanUpSystem() {
httpPrint
(
"http service cleanup"
);
httpPrint
(
"http service cleanup"
);
httpStopSystem
();
httpStopSystem
();
#if
0
#if
1
if
(
httpServer
==
NULL
)
{
if
(
httpServer
==
NULL
)
{
return
;
return
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录