Commit 6dd39694 authored by Fabrice Bellet's avatar Fabrice Bellet Committed by Olivier Crête
Browse files

conncheck: add missing cases when pruning pending checks

When pruning pending checks (after at least one nominated pair has been
obtained), some supplementary cases need to be handled, to ensure that
the property "all pairs and only the pairs having a higher priority than
the nominated pair should have the stun retransmit flag set" remains
true during the whole conncheck:

- a pair "not to be retransmitted" must be removed from the triggered check
  list (because a triggered check would create a new stun request, that
  would defacto ignore the retransmit flag)

- an in-progress pair "not to be retransmitted", for which no stun
  request has been sent (p->stun_transactions == NULL, a transient
  state) must be removed from the conncheck list, just like a waiting
  pair.

- a failed pair must have its flag "retransmit" updated too, just like
  another pair, since a failed pair could match an inbound check, and
  generate a triggered check, based on retransmit flag value : ie only
  if this pair has a chance to become a better nominated pair. See
  NICE_CHECK_FAILED case in priv_schedule_triggered_check().
parent 1e9edb69
......@@ -3140,10 +3140,17 @@ static guint priv_prune_pending_checks (NiceAgent *agent, NiceStream *stream, Ni
/* note: a SHOULD level req. in ICE 8.1.2. "Updating States" (ID-19) */
else if (p->state == NICE_CHECK_IN_PROGRESS) {
if (p->priority < priority) {
priv_remove_pair_from_triggered_check_queue (agent, p);
if (p->retransmit && p->stun_transactions) {
p->retransmit = FALSE;
nice_debug ("Agent %p : pair %p will not be retransmitted.",
agent, p);
} else if (p->retransmit) {
/* Pair in-progress, but stun request not yet sent */
nice_debug ("Agent %p : pair %p removed.", agent, p);
candidate_check_pair_free (agent, p);
stream->conncheck_list = g_slist_delete_link(stream->conncheck_list,
i);
}
} else {
/* We must keep the higher priority pairs running because if a udp
......@@ -3161,6 +3168,12 @@ static guint priv_prune_pending_checks (NiceAgent *agent, NiceStream *stream, Ni
in_progress++;
}
}
/* A triggered check on a failed pair will depend on the retransmit
* flag, so on the relative priority of this pair and the nominated
* pair.
*/
else if (p->state == NICE_CHECK_FAILED)
p->retransmit = (p->priority > priority ? TRUE : FALSE);
i = next;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment