mirror of
https://github.com/craigerl/aprsd.git
synced 2025-06-26 14:05:26 -04:00
Allow disabling sending all AckPackets
This patch adds a new config option 'enable_sending_ack_packets', which is by default set to True. This allows the admin to disable sending Ack Packets for MessagePackets entirely.
This commit is contained in:
parent
d0018a8cd3
commit
6e62ac14b8
@ -136,6 +136,12 @@ aprsd_opts = [
|
|||||||
default=True,
|
default=True,
|
||||||
help="Set this to False, to disable logging of packets to the log file.",
|
help="Set this to False, to disable logging of packets to the log file.",
|
||||||
),
|
),
|
||||||
|
cfg.BoolOpt(
|
||||||
|
"enable_sending_ack_packets",
|
||||||
|
default=True,
|
||||||
|
help="Set this to False, to disable sending of ack packets. This will entirely stop"
|
||||||
|
"APRSD from sending ack packets.",
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
watch_list_opts = [
|
watch_list_opts = [
|
||||||
|
@ -151,6 +151,11 @@ class APRSDProcessPacketThread(APRSDThread):
|
|||||||
def __init__(self, packet_queue):
|
def __init__(self, packet_queue):
|
||||||
self.packet_queue = packet_queue
|
self.packet_queue = packet_queue
|
||||||
super().__init__("ProcessPKT")
|
super().__init__("ProcessPKT")
|
||||||
|
if not CONF.enable_sending_ack_packets:
|
||||||
|
LOG.warning(
|
||||||
|
"Sending ack packets is disabled, messages "
|
||||||
|
"will not be acknowledged.",
|
||||||
|
)
|
||||||
|
|
||||||
def process_ack_packet(self, packet):
|
def process_ack_packet(self, packet):
|
||||||
"""We got an ack for a message, no need to resend it."""
|
"""We got an ack for a message, no need to resend it."""
|
||||||
|
@ -53,7 +53,10 @@ def send(packet: core.Packet, direct=False, aprs_client=None):
|
|||||||
# After prepare, as prepare assigns the msgNo
|
# After prepare, as prepare assigns the msgNo
|
||||||
collector.PacketCollector().tx(packet)
|
collector.PacketCollector().tx(packet)
|
||||||
if isinstance(packet, core.AckPacket):
|
if isinstance(packet, core.AckPacket):
|
||||||
|
if CONF.enable_sending_ack_packets:
|
||||||
_send_ack(packet, direct=direct, aprs_client=aprs_client)
|
_send_ack(packet, direct=direct, aprs_client=aprs_client)
|
||||||
|
else:
|
||||||
|
LOG.info("Sending ack packets is disabled. Not sending AckPacket.")
|
||||||
else:
|
else:
|
||||||
_send_packet(packet, direct=direct, aprs_client=aprs_client)
|
_send_packet(packet, direct=direct, aprs_client=aprs_client)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user