mirror of
https://github.com/craigerl/aprsd.git
synced 2024-12-22 09:31:42 -05:00
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:
parent
740889426a
commit
1f6c55d2bf
@ -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
|
||||
|
@ -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]
|
||||
|
||||
|
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user