Commit 714c9603 authored by Youness Alaoui's avatar Youness Alaoui Committed by Olivier Crête

Do not enable keepalives for tcp candidates

parent 220c6829
...@@ -571,6 +571,10 @@ static gboolean priv_conn_keepalive_tick_unlocked (NiceAgent *agent) ...@@ -571,6 +571,10 @@ static gboolean priv_conn_keepalive_tick_unlocked (NiceAgent *agent)
if (component->selected_pair.local != NULL) { if (component->selected_pair.local != NULL) {
CandidatePair *p = &component->selected_pair; 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) { if (agent->compatibility == NICE_COMPATIBILITY_GOOGLE) {
guint32 priority = nice_candidate_ice_priority_full ( guint32 priority = nice_candidate_ice_priority_full (
NICE_CANDIDATE_TYPE_PREF_PEER_REFLEXIVE, 1, NICE_CANDIDATE_TYPE_PREF_PEER_REFLEXIVE, 1,
...@@ -672,6 +676,10 @@ static gboolean priv_conn_keepalive_tick_unlocked (NiceAgent *agent) ...@@ -672,6 +676,10 @@ static gboolean priv_conn_keepalive_tick_unlocked (NiceAgent *agent)
nice_address_set_port (&stun_server, agent->stun_server_port); 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_agent_init (&stun_agent, STUN_ALL_KNOWN_ATTRIBUTES,
STUN_COMPATIBILITY_RFC3489, 0); STUN_COMPATIBILITY_RFC3489, 0);
...@@ -680,7 +688,8 @@ static gboolean priv_conn_keepalive_tick_unlocked (NiceAgent *agent) ...@@ -680,7 +688,8 @@ static gboolean priv_conn_keepalive_tick_unlocked (NiceAgent *agent)
for (k = component->local_candidates; k; k = k->next) { for (k = component->local_candidates; k; k = k->next) {
NiceCandidate *candidate = (NiceCandidate *) k->data; 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 */ /* send the conncheck */
nice_debug ("Agent %p : resending STUN on %s to keep the " nice_debug ("Agent %p : resending STUN on %s to keep the "
"candidate alive.", agent, candidate->foundation); "candidate alive.", agent, candidate->foundation);
......
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