[sr-dev] git:3.1: tm: t_pick_branch() cannot ingnore the pending blined UACs

Daniel-Constantin Mierla miconda at gmail.com
Sun Mar 6 12:14:59 CET 2011


Module: sip-router
Branch: 3.1
Commit: 2b0aabbfa20de81d3c65464c17ca0d90889721f9
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=2b0aabbfa20de81d3c65464c17ca0d90889721f9

Author: Miklos Tirpak <miklos at iptel.org>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Thu Feb 10 14:26:14 2011 +0100

tm: t_pick_branch() cannot ingnore the pending blined UACs

Empty branches shall be considered pending branches
before their final response is set.
When all the responses were dropped in failure route and a new
blind UAC was added, t_pick_branch() did not realize that
there is still at least one pending branch, it returned an error
instead. Later on, the blind UAC was tried to be canceled causing
deadlock.
(cherry picked from commit 17fc9913737cf3314d317d9b62cfd3dc05f8376e)

---

 modules/tm/t_reply.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/modules/tm/t_reply.c b/modules/tm/t_reply.c
index c18c716..e65d1b9 100644
--- a/modules/tm/t_reply.c
+++ b/modules/tm/t_reply.c
@@ -1042,8 +1042,11 @@ int t_pick_branch(int inc_branch, int inc_code, struct cell *t, int *res_code)
 			}
 			continue;
 		}
-		/* skip 'empty branches' */
-		if (!t->uac[b].request.buffer) continue;
+		/* skip 'empty branches'
+		 * An empty branch without a final response is still considered
+		 * to be a pending, incomplete branch. */
+		if ((!t->uac[b].request.buffer) && (t->uac[b].last_received>=200))
+			continue;
 		/* there is still an unfinished UAC transaction; wait now! */
 		if ( t->uac[b].last_received<200 )
 			return -2;




More information about the sr-dev mailing list