62 free(Config.hum_address); |
62 free(Config.hum_address); |
63 Config.temp_address = Config.hum_address = NULL; |
63 Config.temp_address = Config.hum_address = NULL; |
64 Config.temp_value = 20000; |
64 Config.temp_value = 20000; |
65 Config.temp_state = Config.hum_state = 1; // missing |
65 Config.temp_state = Config.hum_state = 1; // missing |
66 Config.hum_value = 50000; |
66 Config.hum_value = 50000; |
67 |
67 #ifdef HAVE_MOSQUITTO_H |
|
68 if (Config.mosq_host) |
|
69 free(Config.mosq_host); |
|
70 Config.mosq_host = NULL; |
|
71 Config.mosq_port = 1883; |
|
72 #endif |
|
73 |
68 for (tmp2 = Config.units; tmp2; tmp2 = tmp2->next) { |
74 for (tmp2 = Config.units; tmp2; tmp2 = tmp2->next) { |
69 if (tmp2->uuid) |
75 if (tmp2->uuid) |
70 free(tmp2->uuid); |
76 free(tmp2->uuid); |
71 if (tmp2->name) |
77 if (tmp2->name) |
72 free(tmp2->name); |
78 free(tmp2->name); |
1974 return 1; |
1980 return 1; |
1975 } |
1981 } |
1976 } |
1982 } |
1977 syslog(LOG_NOTICE, "rdconfig: using %s", mypath); |
1983 syslog(LOG_NOTICE, "rdconfig: using %s", mypath); |
1978 |
1984 |
|
1985 #ifdef HAVE_MOSQUITTO_H |
|
1986 Config.mosq_host = xstrcpy((char *)"localhost"); |
|
1987 Config.mosq_port = 1883; |
|
1988 #endif |
|
1989 |
1979 if ((cur = xmlDocGetRootElement(doc)) == NULL) { |
1990 if ((cur = xmlDocGetRootElement(doc)) == NULL) { |
1980 syslog(LOG_NOTICE, "XML file %s empty.", mypath); |
1991 syslog(LOG_NOTICE, "XML file %s empty.", mypath); |
1981 xmlFreeDoc(doc); |
1992 xmlFreeDoc(doc); |
1982 return 1; |
1993 return 1; |
1983 } |
1994 } |