Ver código fonte

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 anos atrás
pai
commit
17fc991373
1 arquivos alterados com 5 adições e 2 exclusões
  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;
 			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! */
 		/* there is still an unfinished UAC transaction; wait now! */
 		if ( t->uac[b].last_received<200 )
 		if ( t->uac[b].last_received<200 )
 			return -2;
 			return -2;