提交 06984652 编写于 作者: S Shengliang Guan

The mqtt test has not passed, there are memory leaks, waiting for reconstruction

上级 ab569329
...@@ -39,6 +39,7 @@ int mttIsRuning = 1; ...@@ -39,6 +39,7 @@ int mttIsRuning = 1;
int32_t mqttInitSystem() { int32_t mqttInitSystem() {
int rc = 0; int rc = 0;
#if 0
uint8_t sendbuf[2048]; uint8_t sendbuf[2048];
uint8_t recvbuf[1024]; uint8_t recvbuf[1024];
recntStatus.sendbuf = sendbuf; recntStatus.sendbuf = sendbuf;
...@@ -95,11 +96,13 @@ int32_t mqttInitSystem() { ...@@ -95,11 +96,13 @@ int32_t mqttInitSystem() {
topicPath = NULL; topicPath = NULL;
} }
#endif
return rc; return rc;
} }
int32_t mqttStartSystem() { int32_t mqttStartSystem() {
int rc = 0; int rc = 0;
#if 0
if (recntStatus.user_name != NULL && recntStatus.password != NULL) { if (recntStatus.user_name != NULL && recntStatus.password != NULL) {
mqttInfo("connecting to mqtt://%s:%s@%s:%s/%s/", recntStatus.user_name, recntStatus.password, mqttInfo("connecting to mqtt://%s:%s@%s:%s/%s/", recntStatus.user_name, recntStatus.password,
recntStatus.hostname, recntStatus.port, topicPath); recntStatus.hostname, recntStatus.port, topicPath);
...@@ -116,18 +119,22 @@ int32_t mqttStartSystem() { ...@@ -116,18 +119,22 @@ int32_t mqttStartSystem() {
} else { } else {
mqttInfo("listening for '%s' messages.", recntStatus.topic); mqttInfo("listening for '%s' messages.", recntStatus.topic);
} }
#endif
return rc; return rc;
} }
void mqttStopSystem() { void mqttStopSystem() {
#if 0
mqttClient.error = MQTT_ERROR_SOCKET_ERROR; mqttClient.error = MQTT_ERROR_SOCKET_ERROR;
mttIsRuning = 0; mttIsRuning = 0;
usleep(300000U); usleep(300000U);
mqttCleanup(EXIT_SUCCESS, mqttClient.socketfd, &clientDaemonThread); mqttCleanup(EXIT_SUCCESS, mqttClient.socketfd, &clientDaemonThread);
mqttInfo("mqtt is stoped"); mqttInfo("mqtt is stoped");
#endif
} }
void mqttCleanUpSystem() { void mqttCleanUpSystem() {
#if 0
mqttInfo("starting to cleanup mqtt"); mqttInfo("starting to cleanup mqtt");
free(recntStatus.user_name); free(recntStatus.user_name);
free(recntStatus.password); free(recntStatus.password);
...@@ -136,6 +143,7 @@ void mqttCleanUpSystem() { ...@@ -136,6 +143,7 @@ void mqttCleanUpSystem() {
free(recntStatus.topic); free(recntStatus.topic);
free(topicPath); free(topicPath);
mqttInfo("mqtt is cleaned up"); mqttInfo("mqtt is cleaned up");
#endif
} }
void mqtt_PublishCallback(void** unused, struct mqtt_response_publish* published) { void mqtt_PublishCallback(void** unused, struct mqtt_response_publish* published) {
...@@ -187,9 +195,11 @@ void* mqttClientRefresher(void* client) { ...@@ -187,9 +195,11 @@ void* mqttClientRefresher(void* client) {
} }
void mqttCleanup(int status, int sockfd, pthread_t* client_daemon) { void mqttCleanup(int status, int sockfd, pthread_t* client_daemon) {
#if 0
mqttInfo("clean up mqtt module"); mqttInfo("clean up mqtt module");
if (sockfd != -1) close(sockfd); if (sockfd != -1) close(sockfd);
if (client_daemon != NULL) pthread_cancel(*client_daemon); if (client_daemon != NULL) pthread_cancel(*client_daemon);
#endif
} }
void mqttInitConnCb(void* param, TAOS_RES* result, int32_t code) { void mqttInitConnCb(void* param, TAOS_RES* result, int32_t code) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册