mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
reset attempts if already ack or failed
This commit is contained in:
parent
6f8c5bf7c6
commit
6414d01cc3
1 changed files with 13 additions and 2 deletions
15
tnc/mesh.py
15
tnc/mesh.py
|
@ -445,7 +445,13 @@ class MeshRouter():
|
||||||
for _, item in enumerate(MESH_SIGNALLING_TABLE):
|
for _, item in enumerate(MESH_SIGNALLING_TABLE):
|
||||||
# update entry if exists
|
# update entry if exists
|
||||||
if destination in item[1] and "PING" in item[3]:
|
if destination in item[1] and "PING" in item[3]:
|
||||||
update_entry = [item[0], destination, "", "PING", "", item[5], status]
|
# reset attempts if entry exists and it failed or is acknowledged
|
||||||
|
if item[6] in ["failed", "acknowledged"]:
|
||||||
|
attempt = 0
|
||||||
|
else:
|
||||||
|
attempt = item[5]
|
||||||
|
|
||||||
|
update_entry = [item[0], destination, "", "PING", "",attempt, status]
|
||||||
#print(f"UPDATE {MESH_SIGNALLING_TABLE[_]} >>> {update_entry}")
|
#print(f"UPDATE {MESH_SIGNALLING_TABLE[_]} >>> {update_entry}")
|
||||||
|
|
||||||
self.log.info(f"[MESH] [SIGNALLING TABLE] [UPDATE]: {MESH_SIGNALLING_TABLE[_]} >>> ", update=update_entry)
|
self.log.info(f"[MESH] [SIGNALLING TABLE] [UPDATE]: {MESH_SIGNALLING_TABLE[_]} >>> ", update=update_entry)
|
||||||
|
@ -472,7 +478,12 @@ class MeshRouter():
|
||||||
for _, item in enumerate(MESH_SIGNALLING_TABLE):
|
for _, item in enumerate(MESH_SIGNALLING_TABLE):
|
||||||
# update entry if exists
|
# update entry if exists
|
||||||
if destination in item[1] and "PING" in item[3]:
|
if destination in item[1] and "PING" in item[3]:
|
||||||
update_entry = [item[0], destination, "", "PING-ACK", "", item[5], status]
|
# reset attempts if entry exists and it failed or is acknowledged
|
||||||
|
if item[6] in ["failed", "acknowledged"]:
|
||||||
|
attempt = 0
|
||||||
|
else:
|
||||||
|
attempt = item[5]
|
||||||
|
update_entry = [item[0], destination, "", "PING-ACK", "", attempt, status]
|
||||||
#print(f"UPDATE {MESH_SIGNALLING_TABLE[_]} >>> {update_entry}")
|
#print(f"UPDATE {MESH_SIGNALLING_TABLE[_]} >>> {update_entry}")
|
||||||
self.log.info(f"[MESH] [SIGNALLING TABLE] [UPDATE]: {MESH_SIGNALLING_TABLE[_]} >>> ", update=update_entry)
|
self.log.info(f"[MESH] [SIGNALLING TABLE] [UPDATE]: {MESH_SIGNALLING_TABLE[_]} >>> ", update=update_entry)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue