[sr-dev] git:master:827ec4fc: tm: reset T_ASYNC_SUSPENDED flag at beginning of t_continue()

Daniel-Constantin Mierla miconda at gmail.com
Mon May 30 11:56:01 CEST 2016


Module: kamailio
Branch: master
Commit: 827ec4fc2c9fcc2bf9f814b0545ae64784d8e3b0
URL: https://github.com/kamailio/kamailio/commit/827ec4fc2c9fcc2bf9f814b0545ae64784d8e3b0

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2016-05-30T11:54:34+02:00

tm: reset T_ASYNC_SUSPENDED flag at beginning of t_continue()

- should allow doing t_suspend() inside the route executed by
  t_continue()
- related to GH #644 and #645

---

Modified: modules/tm/t_suspend.c

---

Diff:  https://github.com/kamailio/kamailio/commit/827ec4fc2c9fcc2bf9f814b0545ae64784d8e3b0.diff
Patch: https://github.com/kamailio/kamailio/commit/827ec4fc2c9fcc2bf9f814b0545ae64784d8e3b0.patch

---

diff --git a/modules/tm/t_suspend.c b/modules/tm/t_suspend.c
index 61f742d..828aa38 100644
--- a/modules/tm/t_suspend.c
+++ b/modules/tm/t_suspend.c
@@ -204,8 +204,11 @@ int t_continue(unsigned int hash_index, unsigned int label,
 	t->flags |= T_ASYNC_CONTINUE;   /* we can now know anywhere in kamailio
 					 * that we are executing post a suspend */
 
+	/* transaction is no longer suspended, resetting the SUSPEND flag */
+	t->flags &= ~T_ASYNC_SUSPENDED;
+
 	/* which route block type were we in when we were suspended */
-	cb_type =  FAILURE_CB_TYPE;;
+	cb_type =  FAILURE_CB_TYPE;
 	switch (t->async_backup.backup_route) {
 		case REQUEST_ROUTE:
 			cb_type = FAILURE_CB_TYPE;
@@ -231,7 +234,6 @@ int t_continue(unsigned int hash_index, unsigned int label,
 				/* Either t_continue() has already been
 				* called or the branch has already timed out.
 				* Needless to continue. */
-				t->flags &= ~T_ASYNC_SUSPENDED;
 				UNLOCK_ASYNC_CONTINUE(t);
 				UNREF(t); /* t_unref would kill the transaction */
 				return 1;
@@ -456,14 +458,10 @@ int t_continue(unsigned int hash_index, unsigned int label,
 		t->uac[branch].reply = 0;
 	}
 
-	/*This transaction is no longer suspended so unsetting the SUSPEND flag*/
-	t->flags &= ~T_ASYNC_SUSPENDED;
-
 
 	return 0;
 
 kill_trans:
-	t->flags &= ~T_ASYNC_SUSPENDED;
 	/* The script has hopefully set the error code. If not,
 	 * let us reply with a default error. */
 	if ((kill_transaction_unsafe(t,




More information about the sr-dev mailing list