From 929cddcaacbe8057ebbd831b3e7f33139a971b93 Mon Sep 17 00:00:00 2001 From: Jan-Piet Mens Date: Sun, 21 Feb 2016 18:45:09 +0100 Subject: [PATCH] compile on Raspian with http only closes #85 --- recorder.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/recorder.c b/recorder.c index 84edee8..e234428 100644 --- a/recorder.c +++ b/recorder.c @@ -621,7 +621,7 @@ void handle_message(void *userdata, char *topic, char *payload, size_t payloadle time(&now); monitorhook(ud, now, topic); - debug(ud, "%s (plen=%d, r=%d)", topic, payloadlen, retain); + debug(ud, "%s (plen=%d, r=%d) [%s]", topic, payloadlen, retain, payload); if (payloadlen == 0) { return; } @@ -1271,7 +1271,9 @@ int main(int argc, char **argv) #ifdef WITH_LUA char *luascript = NULL; #endif - int loop_timeout = 0; +#if WITH_MQTT + int loop_timeout = 1000; +#endif int ch, initialize = FALSE; static struct udata udata, *ud = &udata; #ifdef WITH_HTTP @@ -1751,13 +1753,6 @@ int main(int argc, char **argv) olog(LOG_INFO, "Using storage at %s with precision %d", STORAGEDIR, geohash_prec()); -#ifdef WITH_HTTP - if (udata.mgserver == NULL) - loop_timeout = 1000; -#else - loop_timeout = 1000; -#endif - while (run) { #ifdef WITH_MQTT rc = mosquitto_loop(mosq, loop_timeout, /* max-packets */ 1);