GSource *conncheck_timer_source; /* source of conncheck timer */
GSource *keepalive_timer_source; /* source of keepalive timer */
GSList *refresh_list; /* list of CandidateRefresh items */
+ GSList *pruning_refreshes; /* list of Refreshes current being shut down*/
guint64 tie_breaker; /* tie breaker (ICE sect 5.2
"Determining Role" ID-19) */
NiceCompatibility compatibility; /* property: Compatibility mode */
stream = agent_find_stream (agent, cmp->stream_id);
discovery_prune_socket (agent, nsocket);
+ refresh_prune_socket (agent, nsocket);
if (stream)
conn_check_prune_socket (agent, stream, cmp, nsocket);
nice_debug ("timer source is : %p", cand->timer_source);
} else {
+ agent->pruning_refreshes = g_slist_append (agent->pruning_refreshes, cand);
nice_debug ("Agent %p : Sending request to remove TURN allocation "
"for refresh %p", agent, cand);
cand->disposing = TRUE;
nice_debug ("Agent %p : Freeing candidate refresh %p", agent, cand);
agent->refresh_list = g_slist_remove (agent->refresh_list, cand);
+ agent->pruning_refreshes = g_slist_remove (agent->pruning_refreshes, cand);
if (cand->timer_source != NULL) {
g_source_destroy (cand->timer_source);
if (cand->disposing)
continue;
+ agent->pruning_refreshes = g_slist_append (agent->pruning_refreshes, cand);
+
timeout += agent->timer_ta;
cand->disposing = TRUE;
cand->destroy_cb = (GDestroyNotify) on_refresh_removed;
}
/*
+ * Removes the candidate refreshes related to 'nicesock'.
+ */
+void refresh_prune_socket (NiceAgent *agent, NiceSocket *nicesock)
+{
+ GSList *i;
+
+ for (i = agent->refresh_list; i;) {
+ GSList *next = i->next;
+ CandidateRefresh *refresh = i->data;
+
+ if (refresh->nicesock == nicesock)
+ refresh_free(agent, refresh);
+
+ i = next;
+ }
+
+ for (i = agent->pruning_refreshes; i;) {
+ GSList *next = i->next;
+ CandidateRefresh *refresh = i->data;
+
+ if (refresh->nicesock == nicesock)
+ refresh_free(agent, refresh);
+
+ i = next;
+ }
+}
+
+/*
* Adds a new local candidate. Implements the candidate pruning
* defined in ICE spec section 4.1.3 "Eliminating Redundant
* Candidates" (ID-19).
void refresh_prune_candidate (NiceAgent *agent, NiceCandidateImpl *candidate);
void refresh_prune_candidate_async (NiceAgent *agent, NiceCandidateImpl *cand,
NiceTimeoutLockedCallback function);
+void refresh_prune_socket (NiceAgent *agent, NiceSocket *nicesock);
void discovery_free (NiceAgent *agent);