From 2a82fe6cee5c3652c35deb3f71731c9bddbf5186 Mon Sep 17 00:00:00 2001 From: S de Wit Date: Thu, 8 Sep 2022 16:50:20 +0200 Subject: [PATCH] D7AP: switch from SLAVE_PENDING_MASTER to MASTER instead of IDLE A gateway may start sending data while a dialog with one of the nodes is still active. In this case the D7AP switches to D7ASP_STATE_SLAVE_PENDING_MASTER. When the dialog in the slave session completes, the master session would stay pending forever. This in turn would mean the ALP layer would 'leak' a transfer (completion callback never fires, command would never get deallocated). This patch modifies the D7ASP state machine so that D7ASP_STATE_SLAVE_PENDING_MASTER switches to D7ASP_STATE_MASTER as soon as the slave dialog closes. So for I have never been able to get a succesfull response to this master transaction, but at least the ALP layer recovers to a useable state. --- stack/modules/d7ap/d7asp.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/stack/modules/d7ap/d7asp.c b/stack/modules/d7ap/d7asp.c index 5bb06a685..2e9cb71aa 100644 --- a/stack/modules/d7ap/d7asp.c +++ b/stack/modules/d7ap/d7asp.c @@ -842,9 +842,18 @@ void d7asp_signal_dialog_terminated() if (current_master_session.state == D7ASP_MASTER_SESSION_PENDING_DORMANT_TRIGGERED) { switch_state(D7ASP_STATE_PENDING_MASTER); schedule_current_session(); + d7ap_stack_signal_slave_session_terminated(); + + } else if (d7asp_state == D7ASP_STATE_SLAVE_PENDING_MASTER) { + d7ap_stack_signal_slave_session_terminated(); + + switch_state(D7ASP_STATE_MASTER); + d7ap_stack_signal_active_master_session(current_master_session.token); + schedule_current_session(); + } else { switch_state(D7ASP_STATE_IDLE); + d7ap_stack_signal_slave_session_terminated(); } - d7ap_stack_signal_slave_session_terminated(); }