Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
0f204571
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
未验证
提交
0f204571
编写于
6月 19, 2020
作者:
S
Shengliang Guan
提交者:
GitHub
6月 19, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2369 from taosdata/hotfix/crash
change some log
上级
c8377631
0d23f3c3
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
5 addition
and
6 deletion
+5
-6
src/plugins/mqtt/src/mqttSystem.c
src/plugins/mqtt/src/mqttSystem.c
+5
-6
未找到文件。
src/plugins/mqtt/src/mqttSystem.c
浏览文件 @
0f204571
...
...
@@ -122,12 +122,11 @@ void mqttCleanUpSystem() {
}
void
mqtt_PublishCallback
(
void
**
unused
,
struct
mqtt_response_publish
*
published
)
{
mqttPrint
(
"mqtt_PublishCallback"
);
/* note that published->topic_name is NOT null-terminated (here we'll change it to a c-string) */
char
*
topic_name
=
(
char
*
)
malloc
(
published
->
topic_name_size
+
1
);
memcpy
(
topic_name
,
published
->
topic_name
,
published
->
topic_name_size
);
topic_name
[
published
->
topic_name_size
]
=
'\0'
;
mqttPrint
(
"
R
eceived publish('%s'): %s"
,
topic_name
,
(
const
char
*
)
published
->
application_message
);
mqttPrint
(
"
r
eceived publish('%s'): %s"
,
topic_name
,
(
const
char
*
)
published
->
application_message
);
char
_token
[
128
]
=
{
0
};
char
_dbname
[
128
]
=
{
0
};
char
_tablename
[
128
]
=
{
0
};
...
...
@@ -166,12 +165,12 @@ void* mqttClientRefresher(void* client) {
mqtt_sync
((
struct
mqtt_client
*
)
client
);
taosMsleep
(
100
);
}
mqtt
Print
(
"Exit mqttClientR
efresher"
);
mqtt
Trace
(
"quit r
efresher"
);
return
NULL
;
}
void
mqttCleanup
(
int
status
,
int
sockfd
,
pthread_t
*
client_daemon
)
{
mqttPrint
(
"
mqttCleanup
"
);
mqttPrint
(
"
clean up mqtt module
"
);
if
(
sockfd
!=
-
1
)
close
(
sockfd
);
if
(
client_daemon
!=
NULL
)
pthread_cancel
(
*
client_daemon
);
}
...
...
@@ -197,7 +196,7 @@ void mqttQueryInsertCallback(void* param, TAOS_RES* result, int32_t code) {
}
void
mqttReconnectClient
(
struct
mqtt_client
*
client
,
void
**
reconnect_state_vptr
)
{
mqttPrint
(
"
mqttReconnectC
lient"
);
mqttPrint
(
"
reconnect c
lient"
);
struct
reconnect_state_t
*
reconnect_state
=
*
((
struct
reconnect_state_t
**
)
reconnect_state_vptr
);
/* Close the clients socket if this isn't the initial reconnect call */
...
...
@@ -213,7 +212,7 @@ void mqttReconnectClient(struct mqtt_client* client, void** reconnect_state_vptr
/* Open a new socket. */
int
sockfd
=
open_nb_socket
(
reconnect_state
->
hostname
,
reconnect_state
->
port
);
if
(
sockfd
==
-
1
)
{
mqttError
(
"
F
ailed to open socket: "
);
mqttError
(
"
f
ailed to open socket: "
);
mqttCleanup
(
EXIT_FAILURE
,
sockfd
,
NULL
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录