Fix for dupe packets.

Sometimes over KISS clients (RF), we can get duplicate packets
due to having many digipeters in range of the TNC that aprsd is
connected to.   We will now filter out any dupe packets that aprsd
is still in the process of doing it's 3 acks.
This commit is contained in:
Hemna 2023-09-27 14:55:47 -04:00
parent 740889426a
commit 1f6c55d2bf
3 changed files with 14 additions and 8 deletions

View File

@ -4,6 +4,7 @@ CHANGES
v3.2.0
------
* Update Changelog for 3.2.0
* minor cleanup prior to release
* Webchat: fix input maxlength
* WebChat: cleanup some console.logs

View File

@ -72,18 +72,17 @@ class PacketTrack(objectstore.ObjectStoreMixin):
@wrapt.synchronized(lock)
def add(self, packet):
key = int(packet.msgNo)
key = packet.msgNo
self.data[key] = packet
self.total_tracked += 1
@wrapt.synchronized(lock)
def get(self, id):
if id in self.data:
return self.data[id]
def get(self, key):
if key in self.data:
return self.data[key]
@wrapt.synchronized(lock)
def remove(self, id):
key = int(id)
def remove(self, key):
if key in self.data.keys():
del self.data[key]

View File

@ -70,8 +70,14 @@ class APRSDPluginRXThread(APRSDRXThread):
packet = self._client.decode_packet(*args, **kwargs)
# LOG.debug(raw)
packet.log(header="RX")
packets.PacketList().rx(packet)
self.packet_queue.put(packet)
tracked = packets.PacketTrack().get(packet.msgNo)
if not tracked:
# If we are in the process of already ack'ing
# a packet, we should drop the packet
# because it's a dupe within the time that
# we send the 3 acks for the packet.
packets.PacketList().rx(packet)
self.packet_queue.put(packet)
class APRSDProcessPacketThread(APRSDThread):