From ae2fb9003634d0cf8d129bb4c7c2ab1dba4e18ea Mon Sep 17 00:00:00 2001 From: Fabrice Bellet Date: Mon, 15 Jul 2019 14:47:11 +0200 Subject: [PATCH] conncheck: ignore selected pairs for nomination that failed When evaluating the stopping criterion, failed pairs from other streams having the "use_candidate_on_next_check" flag set should be ignored. This should normally not happen, because a pair selected for nomination has no reason to fail when being rechecked, since it previously worked... but it may happen with Skype for Business, when libnice selects a tcp pair for component 1, the peer seems to have no interest in the second component and lets it fail in the middle of the conncheck. --- agent/conncheck.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/agent/conncheck.c b/agent/conncheck.c index 755222d..0e3d1c0 100644 --- a/agent/conncheck.c +++ b/agent/conncheck.c @@ -951,7 +951,8 @@ priv_conn_check_tick_stream_nominate (NiceStream *stream, NiceAgent *agent) continue; for (j = s->conncheck_list; j ; j = j->next) { CandidateCheckPair *p = j->data; - if (p->nominated || p->use_candidate_on_next_check) { + if (p->nominated || (p->use_candidate_on_next_check && + p->state != NICE_CHECK_FAILED)) { other_stream_pair = p; break; } @@ -1058,7 +1059,8 @@ priv_conn_check_tick_stream_nominate (NiceStream *stream, NiceAgent *agent) CandidateCheckPair *p = j->data; if (p->component_id == component->id) continue; - if (p->nominated || p->use_candidate_on_next_check) { + if (p->nominated || (p->use_candidate_on_next_check && + p->state != NICE_CHECK_FAILED)) { other_component_pair = p; break; } -- 2.7.4