mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
interrupt arq session while opening
This commit is contained in:
parent
0326cf612a
commit
cd9b8e5173
|
@ -1369,6 +1369,11 @@ class DATA:
|
|||
if static.ARQ_SESSION:
|
||||
return True
|
||||
|
||||
# Stop waiting and interrupt if data channel is getting closed while opening
|
||||
if static.ARQ_SESSION_STATE == "disconnecting":
|
||||
self.close_session()
|
||||
return False
|
||||
|
||||
# Session connect timeout, send close_session frame to
|
||||
# attempt to clean up the far-side, if it received the
|
||||
# open_session frame and can still hear us.
|
||||
|
@ -1444,6 +1449,8 @@ class DATA:
|
|||
self.send_disconnect_frame()
|
||||
self.arq_cleanup()
|
||||
|
||||
static.ARQ_SESSION_STATE = "disconnected"
|
||||
|
||||
def received_session_close(self, data_in: bytes):
|
||||
"""
|
||||
Closes the session when a close session frame is received and
|
||||
|
|
|
@ -332,9 +332,11 @@ def process_tnc_commands(data):
|
|||
|
||||
# DISCONNECT ----------------------------------------------------------
|
||||
if received_json["type"] == "arq" and received_json["command"] == "disconnect":
|
||||
# send ping frame and wait for ACK
|
||||
try:
|
||||
DATA_QUEUE_TRANSMIT.put(["DISCONNECT"])
|
||||
|
||||
# set early disconnecting state so we can interrupt connection attemtps
|
||||
static.ARQ_SESSION_STATE = "disconnecting"
|
||||
command_response("disconnect", True)
|
||||
except Exception as err:
|
||||
command_response("disconnect", False)
|
||||
|
|
Loading…
Reference in a new issue