mirror of
https://github.com/markqvist/Reticulum.git
synced 2024-11-06 22:30:15 +00:00
Fixed potential division by zero
This commit is contained in:
parent
f4de5d5199
commit
d67c8eb1cd
@ -68,6 +68,7 @@ class Interface:
|
|||||||
self.txb = 0
|
self.txb = 0
|
||||||
self.created = time.time()
|
self.created = time.time()
|
||||||
self.online = False
|
self.online = False
|
||||||
|
self.bitrate = 1e6
|
||||||
|
|
||||||
self.ingress_control = True
|
self.ingress_control = True
|
||||||
self.ic_max_held_announces = Interface.MAX_HELD_ANNOUNCES
|
self.ic_max_held_announces = Interface.MAX_HELD_ANNOUNCES
|
||||||
|
@ -876,7 +876,7 @@ class Transport:
|
|||||||
interface.announce_queue = []
|
interface.announce_queue = []
|
||||||
|
|
||||||
queued_announces = True if len(interface.announce_queue) > 0 else False
|
queued_announces = True if len(interface.announce_queue) > 0 else False
|
||||||
if not queued_announces and outbound_time > interface.announce_allowed_at:
|
if not queued_announces and outbound_time > interface.announce_allowed_at and interface.bitrate != None and interface.bitrate != 0:
|
||||||
tx_time = (len(packet.raw)*8) / interface.bitrate
|
tx_time = (len(packet.raw)*8) / interface.bitrate
|
||||||
wait_time = (tx_time / interface.announce_cap)
|
wait_time = (tx_time / interface.announce_cap)
|
||||||
interface.announce_allowed_at = outbound_time + wait_time
|
interface.announce_allowed_at = outbound_time + wait_time
|
||||||
|
Loading…
Reference in New Issue
Block a user