Преглед изворни кода

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.
Miklos Tirpak пре 14 година
родитељ
комит
17fc991373
1 измењених фајлова са 5 додато и 2 уклоњено
  1. 5 2
      modules/tm/t_reply.c

+ 5 - 2
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;