mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
disallow disconnect when disconnected, disconnecting, failed #289
This commit is contained in:
parent
166bb6aba4
commit
bd198d7c67
16
tnc/sock.py
16
tnc/sock.py
|
@ -360,11 +360,19 @@ def process_tnc_commands(data):
|
|||
# DISCONNECT ----------------------------------------------------------
|
||||
if received_json["type"] == "arq" and received_json["command"] == "disconnect":
|
||||
try:
|
||||
DATA_QUEUE_TRANSMIT.put(["DISCONNECT"])
|
||||
if not static.ARQ_SESSION_STATE in ["disconnecting", "disconnected", "failed"]:
|
||||
DATA_QUEUE_TRANSMIT.put(["DISCONNECT"])
|
||||
|
||||
# set early disconnecting state so we can interrupt connection attempts
|
||||
static.ARQ_SESSION_STATE = "disconnecting"
|
||||
command_response("disconnect", True)
|
||||
# set early disconnecting state so we can interrupt connection attempts
|
||||
static.ARQ_SESSION_STATE = "disconnecting"
|
||||
command_response("disconnect", True)
|
||||
else:
|
||||
command_response("disconnect", False)
|
||||
log.warning(
|
||||
"[SCK] Disconnect command not possible",
|
||||
state=static.ARQ_SESSION_STATE,
|
||||
command=received_json,
|
||||
)
|
||||
except Exception as err:
|
||||
command_response("disconnect", False)
|
||||
log.warning(
|
||||
|
|
Loading…
Reference in a new issue