conncheck: ignore selected pairs for nomination that failed
authorFabrice Bellet <fabrice@bellet.info>
Mon, 15 Jul 2019 12:47:11 +0000 (14:47 +0200)
committerFabrice Bellet <fabrice@bellet.info>
Tue, 30 Jul 2019 18:34:20 +0000 (20:34 +0200)
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

index 755222d..0e3d1c0 100644 (file)
@@ -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;
             }