소스 검색

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;