summaryrefslogtreecommitdiff
path: root/agent/conncheck.c
diff options
context:
space:
mode:
authorYouness Alaoui <youness.alaoui@collabora.co.uk>2014-04-08 03:57:43 -0400
committerOlivier CrĂȘte <olivier.crete@ocrete.ca>2014-05-15 09:43:15 -0400
commit714c9603ac3cc56c4e4da1c09949dc6fd8316ea2 (patch)
treea3ff184b264a832f20ac0952b189c1c7628e0246 /agent/conncheck.c
parent220c6829240b393a1afd2669da475c8aa79d3b4d (diff)
downloadlibnice-714c9603ac3cc56c4e4da1c09949dc6fd8316ea2.tar.gz
Do not enable keepalives for tcp candidates
Diffstat (limited to 'agent/conncheck.c')
-rw-r--r--agent/conncheck.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/agent/conncheck.c b/agent/conncheck.c
index 392de09..bfbf30d 100644
--- a/agent/conncheck.c
+++ b/agent/conncheck.c
@@ -571,6 +571,10 @@ static gboolean priv_conn_keepalive_tick_unlocked (NiceAgent *agent)
if (component->selected_pair.local != NULL) {
CandidatePair *p = &component->selected_pair;
+ /* Disable keepalive checks on TCP candidates */
+ if (p->local->transport != NICE_CANDIDATE_TRANSPORT_UDP)
+ continue;
+
if (agent->compatibility == NICE_COMPATIBILITY_GOOGLE) {
guint32 priority = nice_candidate_ice_priority_full (
NICE_CANDIDATE_TYPE_PREF_PEER_REFLEXIVE, 1,
@@ -672,6 +676,10 @@ static gboolean priv_conn_keepalive_tick_unlocked (NiceAgent *agent)
nice_address_set_port (&stun_server, agent->stun_server_port);
+ /* FIXME: This will cause the stun response to arrive on the socket
+ * but the stun agent will not be able to parse it due to an invalid
+ * stun message since RFC3489 will not be compatible, and the response
+ * will be forwarded to the application as user data */
stun_agent_init (&stun_agent, STUN_ALL_KNOWN_ATTRIBUTES,
STUN_COMPATIBILITY_RFC3489, 0);
@@ -680,7 +688,8 @@ static gboolean priv_conn_keepalive_tick_unlocked (NiceAgent *agent)
for (k = component->local_candidates; k; k = k->next) {
NiceCandidate *candidate = (NiceCandidate *) k->data;
- if (candidate->type == NICE_CANDIDATE_TYPE_HOST) {
+ if (candidate->type == NICE_CANDIDATE_TYPE_HOST &&
+ candidate->transport == NICE_CANDIDATE_TRANSPORT_UDP) {
/* send the conncheck */
nice_debug ("Agent %p : resending STUN on %s to keep the "
"candidate alive.", agent, candidate->foundation);