From f58ff14d7cd76abe6e38c02960f1f61f862ca8ab Mon Sep 17 00:00:00 2001 From: Oliver Jowett Date: Sun, 7 Jun 2015 23:00:24 +0100 Subject: [PATCH] Fix queueing/resending very old Mode A/C messages. Fixes #47. --- debian/changelog | 1 + mode_s.c | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 09f2459..7787566 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,6 +12,7 @@ dump1090-mutability (1.15~dev) UNRELEASED; urgency=medium received data clobbering old data under CPU overload. * Fix endian issues affecting big-endian hosts in Beast input/output and avrmlat output. (github issue #44) + * Fix queueing/resending very old Mode A/C messages (github issue #47) -- Oliver Jowett Thu, 19 Feb 2015 22:39:19 +0000 diff --git a/mode_s.c b/mode_s.c index 090aff6..53fd806 100644 --- a/mode_s.c +++ b/mode_s.c @@ -1221,18 +1221,17 @@ void useModesMessage(struct modesMessage *mm) { // Otherwise, apply a sanity-check filter and only // forward messages when we have seen two of them. - // TODO: buffer the original message and forward it when we - // see a second message? - if (Modes.net) { - if (Modes.net_verbatim || a->messages > 1) { + if (Modes.net_verbatim || mm->msgtype == 32) { + // Unconditionally send + modesQueueOutput(mm); + } else if (a->messages > 1) { // If this is the second message, and we // squelched the first message, then re-emit the // first message now. if (!Modes.net_verbatim && a->messages == 2) { modesQueueOutput(&a->first_message); } - modesQueueOutput(mm); } }