summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.com>2014-10-03 17:10:45 -0400
committerOlivier CrĂȘte <olivier.crete@collabora.com>2014-10-09 16:26:07 -0400
commit9d50cb1bb9c7449fa145b3a1d770383058e0dc53 (patch)
tree8e68b22c6f4dc95296a57634aaba256cc9a2eb5f
parent921ab71947abbf4efe9dd2c6db3edf838536ce6c (diff)
agent: Only add pairs once on gathering done
Also don't try to re-add pairs that already have been added
-rw-r--r--agent/agent.c3
-rw-r--r--agent/conncheck.c6
-rw-r--r--agent/conncheck.h1
3 files changed, 6 insertions, 4 deletions
diff --git a/agent/agent.c b/agent/agent.c
index 771cbac..8088aaf 100644
--- a/agent/agent.c
+++ b/agent/agent.c
@@ -1902,7 +1902,8 @@ void agent_gathering_done (NiceAgent *agent)
break;
}
if (m == NULL) {
- conn_check_add_for_candidate (agent, stream->id, component, remote_candidate);
+ conn_check_add_for_candidate_pair (agent, stream->id, component,
+ local_candidate, remote_candidate);
}
}
}
diff --git a/agent/conncheck.c b/agent/conncheck.c
index 1f57a0a..fb6b87d 100644
--- a/agent/conncheck.c
+++ b/agent/conncheck.c
@@ -1444,7 +1444,7 @@ static void priv_conn_check_add_for_candidate_pair_matched (NiceAgent *agent,
}
}
-static gboolean priv_conn_check_add_for_candidate_pair (NiceAgent *agent,
+gboolean conn_check_add_for_candidate_pair (NiceAgent *agent,
guint stream_id, Component *component, NiceCandidate *local,
NiceCandidate *remote)
{
@@ -1502,7 +1502,7 @@ int conn_check_add_for_candidate (NiceAgent *agent, guint stream_id, Component *
for (i = component->local_candidates; i ; i = i->next) {
NiceCandidate *local = i->data;
- ret = priv_conn_check_add_for_candidate_pair (agent, stream_id, component, local, remote);
+ ret = conn_check_add_for_candidate_pair (agent, stream_id, component, local, remote);
if (ret) {
++added;
@@ -1533,7 +1533,7 @@ int conn_check_add_for_local_candidate (NiceAgent *agent, guint stream_id, Compo
for (i = component->remote_candidates; i ; i = i->next) {
NiceCandidate *remote = i->data;
- ret = priv_conn_check_add_for_candidate_pair (agent, stream_id, component, local, remote);
+ ret = conn_check_add_for_candidate_pair (agent, stream_id, component, local, remote);
if (ret) {
++added;
diff --git a/agent/conncheck.h b/agent/conncheck.h
index 3d3fa4d..e6c2c62 100644
--- a/agent/conncheck.h
+++ b/agent/conncheck.h
@@ -96,6 +96,7 @@ struct _CandidateCheckPair
int conn_check_add_for_candidate (NiceAgent *agent, guint stream_id, Component *component, NiceCandidate *remote);
int conn_check_add_for_local_candidate (NiceAgent *agent, guint stream_id, Component *component, NiceCandidate *local);
+gboolean conn_check_add_for_candidate_pair (NiceAgent *agent, guint stream_id, Component *component, NiceCandidate *local, NiceCandidate *remote);
void conn_check_free (NiceAgent *agent);
gboolean conn_check_schedule_next (NiceAgent *agent);
int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair);