diff options
-rw-r--r-- | aepd/websocket-protocol.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/aepd/websocket-protocol.c b/aepd/websocket-protocol.c index 68eeb73..c2d12a2 100644 --- a/aepd/websocket-protocol.c +++ b/aepd/websocket-protocol.c @@ -132,7 +132,7 @@ callback_linaro_aepd(struct libwebsocket_context *context, gettimeofday(&tv, NULL); ms10 = (tv.tv_sec * 10) + (tv.tv_usec / 100000); - if (ms10 != pss->ms10_last_caliper) { + if (ms10 != pss->ms10_last_caliper && pss->caliper_offset[0] >= 0 && aepd_shared->chans) { pss->ms10_last_caliper = ms10; l = pss->ringbuffer_tail - pss->caliper_offset[0]; @@ -175,7 +175,7 @@ callback_linaro_aepd(struct libwebsocket_context *context, goto send; } - if (pss->issue_timestamp) { + if (pss->issue_timestamp && aepd_shared->chans) { pss->issue_timestamp = 0; /* @@ -199,7 +199,7 @@ callback_linaro_aepd(struct libwebsocket_context *context, goto send; } - if (!pss->channels_sent_flag) { + if (!pss->channels_sent_flag && aepd_shared->chans) { /* signal it's a message with channel names */ *p++ = '='; @@ -234,7 +234,7 @@ callback_linaro_aepd(struct libwebsocket_context *context, * aggregate up to 'budget' results in one websocket message */ - if (!pss->seen_rate) + if (!pss->seen_rate || !aepd_shared->chans) return 0; while (budget--) { |