From 0698465236fb1f68e34f1e4033af939868fe2568 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Tue, 18 Aug 2020 06:40:33 +0000 Subject: [PATCH] The mqtt test has not passed, there are memory leaks, waiting for reconstruction --- src/plugins/mqtt/src/mqttSystem.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/plugins/mqtt/src/mqttSystem.c b/src/plugins/mqtt/src/mqttSystem.c index b64c4715e8..69810e2785 100644 --- a/src/plugins/mqtt/src/mqttSystem.c +++ b/src/plugins/mqtt/src/mqttSystem.c @@ -39,6 +39,7 @@ int mttIsRuning = 1; int32_t mqttInitSystem() { int rc = 0; +#if 0 uint8_t sendbuf[2048]; uint8_t recvbuf[1024]; recntStatus.sendbuf = sendbuf; @@ -95,11 +96,13 @@ int32_t mqttInitSystem() { topicPath = NULL; } +#endif return rc; } int32_t mqttStartSystem() { int rc = 0; +#if 0 if (recntStatus.user_name != NULL && recntStatus.password != NULL) { mqttInfo("connecting to mqtt://%s:%s@%s:%s/%s/", recntStatus.user_name, recntStatus.password, recntStatus.hostname, recntStatus.port, topicPath); @@ -116,18 +119,22 @@ int32_t mqttStartSystem() { } else { mqttInfo("listening for '%s' messages.", recntStatus.topic); } +#endif return rc; } void mqttStopSystem() { +#if 0 mqttClient.error = MQTT_ERROR_SOCKET_ERROR; mttIsRuning = 0; usleep(300000U); mqttCleanup(EXIT_SUCCESS, mqttClient.socketfd, &clientDaemonThread); mqttInfo("mqtt is stoped"); +#endif } void mqttCleanUpSystem() { +#if 0 mqttInfo("starting to cleanup mqtt"); free(recntStatus.user_name); free(recntStatus.password); @@ -136,6 +143,7 @@ void mqttCleanUpSystem() { free(recntStatus.topic); free(topicPath); mqttInfo("mqtt is cleaned up"); +#endif } void mqtt_PublishCallback(void** unused, struct mqtt_response_publish* published) { @@ -187,9 +195,11 @@ void* mqttClientRefresher(void* client) { } void mqttCleanup(int status, int sockfd, pthread_t* client_daemon) { +#if 0 mqttInfo("clean up mqtt module"); if (sockfd != -1) close(sockfd); if (client_daemon != NULL) pthread_cancel(*client_daemon); +#endif } void mqttInitConnCb(void* param, TAOS_RES* result, int32_t code) { -- GitLab