Commit a8934fa2 authored by Youness Alaoui's avatar Youness Alaoui

Send a keepalive/conncheck as soon as we establish connectivity.. this should...

Send a keepalive/conncheck as soon as we establish connectivity.. this should help with a race condition we get with gtalk
parent ce1f1aea
......@@ -218,7 +218,6 @@ void component_update_selected_pair (Component *component, const CandidatePair *
component->selected_pair.remote = pair->remote;
component->selected_pair.priority = pair->priority;
}
/*
......
......@@ -504,16 +504,13 @@ static gboolean priv_conn_keepalive_retransmissions_tick (gpointer pointer)
*
* @return will return FALSE when no more pending timers.
*/
static gboolean priv_conn_keepalive_tick (gpointer pointer)
static gboolean priv_conn_keepalive_tick_unlocked (NiceAgent *agent)
{
NiceAgent *agent = pointer;
GSList *i, *j;
int errors = 0;
gboolean ret = FALSE;
size_t buf_len = 0;
g_static_rec_mutex_lock (&agent->mutex);
/* case 1: session established and media flowing
* (ref ICE sect 10 "Keepalives" ID-19) */
for (i = agent->streams; i; i = i->next) {
......@@ -633,10 +630,22 @@ static gboolean priv_conn_keepalive_tick (gpointer pointer)
ret = TRUE;
done:
return ret;
}
static gboolean priv_conn_keepalive_tick (gpointer pointer)
{
NiceAgent *agent = pointer;
gboolean ret;
g_static_rec_mutex_lock (&agent->mutex);
ret = priv_conn_keepalive_tick_unlocked (agent);
g_static_rec_mutex_unlock (&agent->mutex);
return ret;
}
static gboolean priv_turn_allocate_refresh_retransmissions_tick (gpointer pointer)
{
CandidateRefresh *cand = (CandidateRefresh *) pointer;
......@@ -941,6 +950,8 @@ static gboolean priv_update_selected_pair (NiceAgent *agent, Component *componen
component->selected_pair.remote = pair->remote;
component->selected_pair.priority = pair->priority;
priv_conn_keepalive_tick_unlocked (agent);
agent_signal_new_selected_pair (agent, pair->stream_id, component->id, pair->local->foundation, pair->remote->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