summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabrice Bellet <fabrice@bellet.info>2020-04-20 23:29:49 +0200
committerOlivier CrĂȘte <olivier.crete@ocrete.ca>2020-05-07 17:46:05 +0000
commita2fb11fc34a1cf34fad7f8def5977828ee2bc27e (patch)
tree43f2532ec3eaaac4e798b6c02dd4dd24e3b403c6
parente7b049429fc3e1d5a5ce9197d5d5c128d599e379 (diff)
conncheck: simplify the test to find a matching local candidate
Since we keep a relation between a succeeded and its discovered pair, we can just test for the socket associated to a given pair, and eventually follow the link to the parent succeeded pair.
-rw-r--r--agent/conncheck.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/agent/conncheck.c b/agent/conncheck.c
index 7ba378b..67d4f5b 100644
--- a/agent/conncheck.c
+++ b/agent/conncheck.c
@@ -3203,13 +3203,9 @@ static gboolean priv_schedule_triggered_check (NiceAgent *agent, NiceStream *str
p = i->data;
if (p->component_id == component->id &&
p->remote == remote_cand &&
- ((p->local->transport == NICE_CANDIDATE_TRANSPORT_TCP_PASSIVE &&
- p->sockptr == local_socket) ||
- (p->local->transport != NICE_CANDIDATE_TRANSPORT_TCP_PASSIVE &&
- p->local->sockptr == local_socket))) {
- /* We don't check for p->sockptr because in the case of
- * tcp-active we don't want to retrigger a check on a pair that
- * was FAILED when a peer-reflexive pair was created */
+ p->sockptr == local_socket) {
+ /* If we match with a peer-reflexive discovered pair, we
+ * use the parent succeeded pair instead */
if (p->succeeded_pair != NULL) {
g_assert_cmpint (p->state, ==, NICE_CHECK_DISCOVERED);