Commit 2dff1e17 authored by Youness Alaoui's avatar Youness Alaoui

unse the timer's source if they return FALSE

parent 6b56e136
check for the cookie and act accordingly for incoming messages.
unset the timer's source if they return FALSE
channel bind have a 10 minutes expiration :@
nice_socket_recv returns -1 means we must close the nice_socket and stop all connchecks/candidates and reelect if was eleected...
Add HTTP Digest support
......
......@@ -256,7 +256,7 @@ static gboolean priv_conn_check_tick_stream (Stream *stream, NiceAgent *agent, G
for (i = stream->conncheck_list; i ; i = i->next) {
CandidateCheckPair *p = i->data;
if (p->state == NICE_CHECK_IN_PROGRESS) {
if (p->stun_message.buffer == NULL) {
nice_debug ("Agent %p : STUN connectivity check was cancelled, marking as done.", agent);
......@@ -662,8 +662,14 @@ static gboolean priv_conn_keepalive_tick (gpointer pointer)
g_static_rec_mutex_lock (&agent->mutex);
ret = priv_conn_keepalive_tick_unlocked (agent);
if (ret == FALSE) {
if (agent->keepalive_timer_source) {
g_source_destroy (agent->keepalive_timer_source);
g_source_unref (agent->keepalive_timer_source);
agent->keepalive_timer_source = NULL;
}
}
g_static_rec_mutex_unlock (&agent->mutex);
return ret;
}
......@@ -756,6 +762,12 @@ static void priv_turn_allocate_refresh_tick_unlocked (CandidateRefresh *cand)
nice_debug ("Agent %p : Sending allocate Refresh %d", cand->agent, buffer_len);
if (cand->tick_source != NULL) {
g_source_destroy (cand->tick_source);
g_source_unref (cand->tick_source);
cand->tick_source = NULL;
}
if (buffer_len > 0) {
stun_timer_start (&cand->timer);
......@@ -763,12 +775,6 @@ static void priv_turn_allocate_refresh_tick_unlocked (CandidateRefresh *cand)
nice_socket_send (cand->nicesock, &cand->server,
buffer_len, (gchar *)cand->stun_buffer);
if (cand->tick_source != NULL) {
g_source_destroy (cand->tick_source);
g_source_unref (cand->tick_source);
cand->tick_source = NULL;
}
cand->tick_source = agent_timeout_add_with_context (cand->agent,
stun_timer_remainder (&cand->timer),
priv_turn_allocate_refresh_retransmissions_tick, cand);
......
......@@ -975,6 +975,13 @@ static gboolean priv_discovery_tick (gpointer pointer)
g_static_rec_mutex_lock (&agent->mutex);
ret = priv_discovery_tick_unlocked (pointer);
if (ret == FALSE) {
if (agent->discovery_timer_source != NULL) {
g_source_destroy (agent->discovery_timer_source);
g_source_unref (agent->discovery_timer_source);
agent->discovery_timer_source = NULL;
}
}
g_static_rec_mutex_unlock (&agent->mutex);
return ret;
......
......@@ -660,6 +660,13 @@ priv_retransmissions_tick (gpointer pointer)
g_static_rec_mutex_lock (&priv->nice->mutex);
ret = priv_retransmissions_tick_unlocked (priv);
if (ret == FALSE) {
if (priv->tick_source != NULL) {
g_source_destroy (priv->tick_source);
g_source_unref (priv->tick_source);
priv->tick_source = NULL;
}
}
g_static_rec_mutex_unlock (&priv->nice->mutex);
return ret;
......
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