summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabrice Bellet <fabrice@bellet.info>2020-04-09 16:47:17 +0200
committerOlivier CrĂȘte <olivier.crete@collabora.com>2020-05-05 21:12:20 -0400
commit6dd3969404da66ee347313b7c9bd648579e7b9bb (patch)
tree6d14c4d21c786736c9442d24042b64c08237d9fd
parent1e9edb69af3148d2b58349749c9af8b27b1fc100 (diff)
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().
-rw-r--r--agent/conncheck.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/agent/conncheck.c b/agent/conncheck.c
index abaf5f2..41d8c92 100644
--- a/agent/conncheck.c
+++ b/agent/conncheck.c
@@ -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;
}