thermferm/server.c

changeset 557
ae17042a6d39
parent 554
ab9f22ab57b5
child 562
119129969d37
--- a/thermferm/server.c	Wed Aug 01 22:27:58 2018 +0200
+++ b/thermferm/server.c	Thu Aug 02 12:20:06 2018 +0200
@@ -1029,10 +1029,8 @@
 	    if (strlen(ibuf)) {
 		if (strcmp(ibuf, (char *)".") == 0) {
 		    srv_send((char *)"219 Accepted Global record");
-#ifdef HAVE_MOSQUITTO_H
 		    if (mqtt_reconnect)
 			mqtt_connect();
-#endif
 		    return 1;
 		}
 		kwd = strtok(ibuf, ",\0");
@@ -1112,9 +1110,7 @@
 		    } else if (strcmp(kwd, (char *)"MQTT_HOST") == 0) {
 			if (val && Config.mqtt_host && (strcmp(val, Config.mqtt_host)))
 			    syslog(LOG_NOTICE, "Global MQTT host `%s' to `%s'", Config.mqtt_host, val);
-#ifdef HAVE_MOSQUITTO_H
 			mqtt_disconnect();
-#endif
 			mqtt_reconnect = 1;
 			if (Config.mqtt_host)
 			    free(Config.mqtt_host);
@@ -1127,9 +1123,7 @@
 			if (sscanf(val, "%d", &ival) == 1) {
 			    if (Config.mqtt_port != ival) {
 				syslog(LOG_NOTICE, "Global MQTT port %d to %d", Config.mqtt_port, ival);
-#ifdef HAVE_MOSQUITTO_H
 				mqtt_disconnect();
-#endif
 				mqtt_reconnect = 1;
 			        Config.mqtt_port = ival;
 			    }
@@ -1138,9 +1132,7 @@
 		    } else if (strcmp(kwd, (char *)"MQTT_USER") == 0) {
 			if (val && Config.mqtt_username && (strcmp(val, Config.mqtt_username)))
 			    syslog(LOG_NOTICE, "Global MQTT username `%s' to `%s'", Config.mqtt_username, val);
-#ifdef HAVE_MOSQUITTO_H
 			mqtt_disconnect();
-#endif
 			mqtt_reconnect = 1;
 			if (Config.mqtt_username)
 			    free(Config.mqtt_username);
@@ -1152,9 +1144,7 @@
 		    } else if (strcmp(kwd, (char *)"MQTT_PASS") == 0) {
 			if (val && Config.mqtt_password && (strcmp(val, Config.mqtt_password)))
 			    syslog(LOG_NOTICE, "Global MQTT password `%s' to `%s'", Config.mqtt_password, val);
-#ifdef HAVE_MOSQUITTO_H
 			mqtt_disconnect();
-#endif
 			mqtt_reconnect = 1;
 			if (Config.mqtt_password)
 			    free(Config.mqtt_password);
@@ -2668,7 +2658,6 @@
 				}
 
 			    }
-#ifdef HAVE_MOSQUITTO_H
 			    if (unit->mqtt_flag) {
 				    if (debug)
 					    fprintf(stdout, "flag value %d\n", unit->mqtt_flag);
@@ -2682,7 +2671,6 @@
 				}
 			    	unit->mqtt_flag |= MQTT_FLAG_DLOG;	// Something to log
 			    }
-#endif
 			}
 		    }
 		}

mercurial